text
stringlengths
8
4.13M
extern crate foreach; use foreach::*; pub fn reply(message: &str) -> &str { let message = message.trim_right(); let suffix: String = message .chars() .rev() .take(1) .into_iter() .collect(); let all_caps_message = all_caps(&message); match all_caps_message { false => { match suffix.as_str() { "?" => "Sure.", "" => "Fine. Be that way!", _ => "Whatever.", } } true => match suffix.as_str() { "?" => "Calm down, I know what I'm doing!", _ => "Whoa, chill out!", } } } fn all_caps(message: &str) -> bool { let mut all_caps = true; let chr_it = message.chars(); let alpha = chr_it .filter(|chr| chr.is_alphabetic()) .collect::<String>(); if alpha.len() == 0 { return false; } alpha.chars() .filter(move |chr| chr.is_alphabetic()) .foreach(|chr, _| { if chr.is_lowercase() { all_caps = false; } }); all_caps }
// Copyright 2022 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::sync::Arc; use common_exception::Result; use common_expression::types::StringType; use common_expression::DataBlock; use common_expression::DataSchemaRef; use common_expression::FromData; use common_meta_api::ShareApi; use common_meta_app::share::GetShareGrantTenantsReq; use common_meta_app::share::ShareNameIdent; use common_users::UserApiProvider; use crate::interpreters::Interpreter; use crate::pipelines::PipelineBuildResult; use crate::sessions::QueryContext; use crate::sessions::TableContext; use crate::sql::plans::share::ShowGrantTenantsOfSharePlan; pub struct ShowGrantTenantsOfShareInterpreter { ctx: Arc<QueryContext>, plan: ShowGrantTenantsOfSharePlan, } impl ShowGrantTenantsOfShareInterpreter { pub fn try_create(ctx: Arc<QueryContext>, plan: ShowGrantTenantsOfSharePlan) -> Result<Self> { Ok(ShowGrantTenantsOfShareInterpreter { ctx, plan }) } } #[async_trait::async_trait] impl Interpreter for ShowGrantTenantsOfShareInterpreter { fn name(&self) -> &str { "ShowGrantTenantsOfShareInterpreter" } fn schema(&self) -> DataSchemaRef { self.plan.schema() } async fn execute2(&self) -> Result<PipelineBuildResult> { let meta_api = UserApiProvider::instance().get_meta_store_client(); let tenant = self.ctx.get_tenant(); let req = GetShareGrantTenantsReq { share_name: ShareNameIdent { tenant, share_name: self.plan.share_name.clone(), }, }; let resp = meta_api.get_grant_tenants_of_share(req).await?; if resp.accounts.is_empty() { return Ok(PipelineBuildResult::create()); } let mut granted_owns: Vec<Vec<u8>> = vec![]; let mut accounts: Vec<Vec<u8>> = vec![]; for account in resp.accounts { granted_owns.push(account.grant_on.to_string().as_bytes().to_vec()); accounts.push(account.account.clone().as_bytes().to_vec()); } PipelineBuildResult::from_blocks(vec![DataBlock::new_from_columns(vec![ StringType::from_data(granted_owns), StringType::from_data(accounts), ])]) } }
const INPUT: &str = include_str!("./input"); fn part_1() -> usize { count_by_slope(3, 1) } fn part_2() -> usize { [(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)] .iter() .map(|(x, y)| count_by_slope(*x, *y)) .product() } fn count_by_slope(step_x: usize, step_y: usize) -> usize { INPUT .trim_end() .lines() .step_by(step_y) .enumerate() .filter(|(i, line)| line.chars().cycle().nth(i * step_x) == Some('#')) .count() } #[test] fn test_part_1() { assert_eq!(part_1(), 280); } #[test] fn test_part_2() { assert_eq!(part_2(), 4355551200); }
/// validates ParseError Eq implementation macro_rules! validate { ($cond:expr, $e:expr) => { if !($cond) { return Err($e); } }; ($cond:expr, $fmt:expr, $($arg:tt)+) => { if !($cond) { return Err($fmt, $($arg)+); } }; }
use nickel::{Request, Response, Middleware, MiddlewareResult}; pub struct Logger; impl<D> Middleware<D> for Logger { fn invoke<'mw, 'conn>(&self, req: &mut Request<'mw, 'conn, D>, res: Response<'mw, D>) -> MiddlewareResult<'mw, D> { println!("Request from: {:?}", req.origin.uri); res.next_middleware() } }
extern crate iron; extern crate router; use iron::prelude::*; use iron::status; use router::Router; fn main() { let mut router = Router::new(); router.get("/", suckit_nerds, "index"); router.get("/:query", suckit_nerds, "show"); fn suckit_nerds(req: &mut Request) -> IronResult<Response> { let ref query = match req.extensions.get::<Router>().unwrap().find("query") { Some(q) => q, None => "Nerds" }; Ok( Response::with( (status::Ok, format!("Suckit {}!", query)) ) ) } Iron::new(router).http("localhost:3000").unwrap(); println!("On 3000"); }
#![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)] #[repr(transparent)] #[doc(hidden)] pub struct IInjectedInputGamepadInfo(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInjectedInputGamepadInfo { type Vtable = IInjectedInputGamepadInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x20ae9a3f_df11_4572_a9ab_d75b8a5e48ad); } #[repr(C)] #[doc(hidden)] pub struct IInjectedInputGamepadInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(feature = "Gaming_Input")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut super::super::super::super::Gaming::Input::GamepadButtons) -> ::windows::core::HRESULT, #[cfg(not(feature = "Gaming_Input"))] usize, #[cfg(feature = "Gaming_Input")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: super::super::super::super::Gaming::Input::GamepadButtons) -> ::windows::core::HRESULT, #[cfg(not(feature = "Gaming_Input"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInjectedInputGamepadInfoFactory(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInjectedInputGamepadInfoFactory { type Vtable = IInjectedInputGamepadInfoFactory_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x59596876_6c39_4ec4_8b2a_29ef7de18aca); } #[repr(C)] #[doc(hidden)] pub struct IInjectedInputGamepadInfoFactory_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(feature = "Gaming_Input")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, reading: super::super::super::super::Gaming::Input::GamepadReading, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Gaming_Input"))] usize, ); #[repr(transparent)] #[doc(hidden)] pub struct IInjectedInputKeyboardInfo(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInjectedInputKeyboardInfo { type Vtable = IInjectedInputKeyboardInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4b46d140_2b6a_5ffa_7eae_bd077b052acd); } #[repr(C)] #[doc(hidden)] pub struct IInjectedInputKeyboardInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputKeyOptions) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputKeyOptions) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut u16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: u16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut u16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: u16) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInjectedInputMouseInfo(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInjectedInputMouseInfo { type Vtable = IInjectedInputMouseInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x96f56e6b_e47a_5cf4_418d_8a5fb9670c7d); } #[repr(C)] #[doc(hidden)] pub struct IInjectedInputMouseInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputMouseOptions) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputMouseOptions) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInjectedInputPenInfo(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInjectedInputPenInfo { type Vtable = IInjectedInputPenInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6b40ad03_ca1e_5527_7e02_2828540bb1d4); } #[repr(C)] #[doc(hidden)] pub struct IInjectedInputPenInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputPointerInfo) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputPointerInfo) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputPenButtons) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputPenButtons) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputPenParameters) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputPenParameters) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: i32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInjectedInputTouchInfo(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInjectedInputTouchInfo { type Vtable = IInjectedInputTouchInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x224fd1df_43e8_5ef5_510a_69ca8c9b4c28); } #[repr(C)] #[doc(hidden)] pub struct IInjectedInputTouchInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputRectangle) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputRectangle) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputPointerInfo) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputPointerInfo) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: f64) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut InjectedInputTouchParameters) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: InjectedInputTouchParameters) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInputInjector(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInputInjector { type Vtable = IInputInjector_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x8ec26f84_0b02_4bd2_ad7a_3d4658be3e18); } #[repr(C)] #[doc(hidden)] pub struct IInputInjector_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, #[cfg(feature = "Foundation_Collections")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, input: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation_Collections"))] usize, #[cfg(feature = "Foundation_Collections")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, input: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation_Collections"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visualmode: InjectedInputVisualizationMode) -> ::windows::core::HRESULT, #[cfg(feature = "Foundation_Collections")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, input: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Foundation_Collections"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visualmode: InjectedInputVisualizationMode) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, input: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, shortcut: InjectedInputShortcut) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInputInjector2(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInputInjector2 { type Vtable = IInputInjector2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x8e7a905d_1453_43a7_9bcb_06d6d7b305f7); } #[repr(C)] #[doc(hidden)] pub struct IInputInjector2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, input: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInputInjectorStatics(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInputInjectorStatics { type Vtable = IInputInjectorStatics_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xdeae6943_7402_4141_a5c6_0c01aa57b16a); } #[repr(C)] #[doc(hidden)] pub struct IInputInjectorStatics_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[doc(hidden)] pub struct IInputInjectorStatics2(pub ::windows::core::IInspectable); unsafe impl ::windows::core::Interface for IInputInjectorStatics2 { type Vtable = IInputInjectorStatics2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa4db38fb_dd8c_414f_95ea_f87ef4c0ae6c); } #[repr(C)] #[doc(hidden)] pub struct IInputInjectorStatics2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, values: *mut *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, result__: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputButtonChangeKind(pub i32); impl InjectedInputButtonChangeKind { pub const None: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(0i32); pub const FirstButtonDown: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(1i32); pub const FirstButtonUp: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(2i32); pub const SecondButtonDown: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(3i32); pub const SecondButtonUp: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(4i32); pub const ThirdButtonDown: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(5i32); pub const ThirdButtonUp: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(6i32); pub const FourthButtonDown: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(7i32); pub const FourthButtonUp: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(8i32); pub const FifthButtonDown: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(9i32); pub const FifthButtonUp: InjectedInputButtonChangeKind = InjectedInputButtonChangeKind(10i32); } impl ::core::convert::From<i32> for InjectedInputButtonChangeKind { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputButtonChangeKind { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputButtonChangeKind { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputButtonChangeKind;i4)"); } impl ::windows::core::DefaultType for InjectedInputButtonChangeKind { type DefaultType = Self; } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct InjectedInputGamepadInfo(pub ::windows::core::IInspectable); impl InjectedInputGamepadInfo { pub fn new() -> ::windows::core::Result<Self> { Self::IActivationFactory(|f| f.activate_instance::<Self>()) } fn IActivationFactory<R, F: FnOnce(&::windows::core::IActivationFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InjectedInputGamepadInfo, ::windows::core::IActivationFactory> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } #[cfg(feature = "Gaming_Input")] pub fn Buttons(&self) -> ::windows::core::Result<super::super::super::super::Gaming::Input::GamepadButtons> { let this = self; unsafe { let mut result__: super::super::super::super::Gaming::Input::GamepadButtons = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<super::super::super::super::Gaming::Input::GamepadButtons>(result__) } } #[cfg(feature = "Gaming_Input")] pub fn SetButtons(&self, value: super::super::super::super::Gaming::Input::GamepadButtons) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), value).ok() } } pub fn LeftThumbstickX(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetLeftThumbstickX(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), value).ok() } } pub fn LeftThumbstickY(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetLeftThumbstickY(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), value).ok() } } pub fn LeftTrigger(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetLeftTrigger(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), value).ok() } } pub fn RightThumbstickX(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetRightThumbstickX(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).15)(::core::mem::transmute_copy(this), value).ok() } } pub fn RightThumbstickY(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).16)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetRightThumbstickY(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).17)(::core::mem::transmute_copy(this), value).ok() } } pub fn RightTrigger(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).18)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetRightTrigger(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).19)(::core::mem::transmute_copy(this), value).ok() } } #[cfg(feature = "Gaming_Input")] pub fn CreateInstanceFromGamepadReading<'a, Param0: ::windows::core::IntoParam<'a, super::super::super::super::Gaming::Input::GamepadReading>>(reading: Param0) -> ::windows::core::Result<InjectedInputGamepadInfo> { Self::IInjectedInputGamepadInfoFactory(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), reading.into_param().abi(), &mut result__).from_abi::<InjectedInputGamepadInfo>(result__) }) } pub fn IInjectedInputGamepadInfoFactory<R, F: FnOnce(&IInjectedInputGamepadInfoFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InjectedInputGamepadInfo, IInjectedInputGamepadInfoFactory> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } } unsafe impl ::windows::core::RuntimeType for InjectedInputGamepadInfo { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.Input.Preview.Injection.InjectedInputGamepadInfo;{20ae9a3f-df11-4572-a9ab-d75b8a5e48ad})"); } unsafe impl ::windows::core::Interface for InjectedInputGamepadInfo { type Vtable = IInjectedInputGamepadInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x20ae9a3f_df11_4572_a9ab_d75b8a5e48ad); } impl ::windows::core::RuntimeName for InjectedInputGamepadInfo { const NAME: &'static str = "Windows.UI.Input.Preview.Injection.InjectedInputGamepadInfo"; } impl ::core::convert::From<InjectedInputGamepadInfo> for ::windows::core::IUnknown { fn from(value: InjectedInputGamepadInfo) -> Self { value.0 .0 } } impl ::core::convert::From<&InjectedInputGamepadInfo> for ::windows::core::IUnknown { fn from(value: &InjectedInputGamepadInfo) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for InjectedInputGamepadInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a InjectedInputGamepadInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<InjectedInputGamepadInfo> for ::windows::core::IInspectable { fn from(value: InjectedInputGamepadInfo) -> Self { value.0 } } impl ::core::convert::From<&InjectedInputGamepadInfo> for ::windows::core::IInspectable { fn from(value: &InjectedInputGamepadInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for InjectedInputGamepadInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a InjectedInputGamepadInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputKeyOptions(pub u32); impl InjectedInputKeyOptions { pub const None: InjectedInputKeyOptions = InjectedInputKeyOptions(0u32); pub const ExtendedKey: InjectedInputKeyOptions = InjectedInputKeyOptions(1u32); pub const KeyUp: InjectedInputKeyOptions = InjectedInputKeyOptions(2u32); pub const ScanCode: InjectedInputKeyOptions = InjectedInputKeyOptions(8u32); pub const Unicode: InjectedInputKeyOptions = InjectedInputKeyOptions(4u32); } impl ::core::convert::From<u32> for InjectedInputKeyOptions { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputKeyOptions { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputKeyOptions { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputKeyOptions;u4)"); } impl ::windows::core::DefaultType for InjectedInputKeyOptions { type DefaultType = Self; } impl ::core::ops::BitOr for InjectedInputKeyOptions { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for InjectedInputKeyOptions { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for InjectedInputKeyOptions { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for InjectedInputKeyOptions { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for InjectedInputKeyOptions { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct InjectedInputKeyboardInfo(pub ::windows::core::IInspectable); impl InjectedInputKeyboardInfo { pub fn new() -> ::windows::core::Result<Self> { Self::IActivationFactory(|f| f.activate_instance::<Self>()) } fn IActivationFactory<R, F: FnOnce(&::windows::core::IActivationFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InjectedInputKeyboardInfo, ::windows::core::IActivationFactory> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn KeyOptions(&self) -> ::windows::core::Result<InjectedInputKeyOptions> { let this = self; unsafe { let mut result__: InjectedInputKeyOptions = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputKeyOptions>(result__) } } pub fn SetKeyOptions(&self, value: InjectedInputKeyOptions) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), value).ok() } } pub fn ScanCode(&self) -> ::windows::core::Result<u16> { let this = self; unsafe { let mut result__: u16 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<u16>(result__) } } pub fn SetScanCode(&self, value: u16) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), value).ok() } } pub fn VirtualKey(&self) -> ::windows::core::Result<u16> { let this = self; unsafe { let mut result__: u16 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<u16>(result__) } } pub fn SetVirtualKey(&self, value: u16) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), value).ok() } } } unsafe impl ::windows::core::RuntimeType for InjectedInputKeyboardInfo { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.Input.Preview.Injection.InjectedInputKeyboardInfo;{4b46d140-2b6a-5ffa-7eae-bd077b052acd})"); } unsafe impl ::windows::core::Interface for InjectedInputKeyboardInfo { type Vtable = IInjectedInputKeyboardInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4b46d140_2b6a_5ffa_7eae_bd077b052acd); } impl ::windows::core::RuntimeName for InjectedInputKeyboardInfo { const NAME: &'static str = "Windows.UI.Input.Preview.Injection.InjectedInputKeyboardInfo"; } impl ::core::convert::From<InjectedInputKeyboardInfo> for ::windows::core::IUnknown { fn from(value: InjectedInputKeyboardInfo) -> Self { value.0 .0 } } impl ::core::convert::From<&InjectedInputKeyboardInfo> for ::windows::core::IUnknown { fn from(value: &InjectedInputKeyboardInfo) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for InjectedInputKeyboardInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a InjectedInputKeyboardInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<InjectedInputKeyboardInfo> for ::windows::core::IInspectable { fn from(value: InjectedInputKeyboardInfo) -> Self { value.0 } } impl ::core::convert::From<&InjectedInputKeyboardInfo> for ::windows::core::IInspectable { fn from(value: &InjectedInputKeyboardInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for InjectedInputKeyboardInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a InjectedInputKeyboardInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct InjectedInputMouseInfo(pub ::windows::core::IInspectable); impl InjectedInputMouseInfo { pub fn new() -> ::windows::core::Result<Self> { Self::IActivationFactory(|f| f.activate_instance::<Self>()) } fn IActivationFactory<R, F: FnOnce(&::windows::core::IActivationFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InjectedInputMouseInfo, ::windows::core::IActivationFactory> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn MouseOptions(&self) -> ::windows::core::Result<InjectedInputMouseOptions> { let this = self; unsafe { let mut result__: InjectedInputMouseOptions = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputMouseOptions>(result__) } } pub fn SetMouseOptions(&self, value: InjectedInputMouseOptions) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), value).ok() } } pub fn MouseData(&self) -> ::windows::core::Result<u32> { let this = self; unsafe { let mut result__: u32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<u32>(result__) } } pub fn SetMouseData(&self, value: u32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), value).ok() } } pub fn DeltaY(&self) -> ::windows::core::Result<i32> { let this = self; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } pub fn SetDeltaY(&self, value: i32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), value).ok() } } pub fn DeltaX(&self) -> ::windows::core::Result<i32> { let this = self; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } pub fn SetDeltaX(&self, value: i32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), value).ok() } } pub fn TimeOffsetInMilliseconds(&self) -> ::windows::core::Result<u32> { let this = self; unsafe { let mut result__: u32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), &mut result__).from_abi::<u32>(result__) } } pub fn SetTimeOffsetInMilliseconds(&self, value: u32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).15)(::core::mem::transmute_copy(this), value).ok() } } } unsafe impl ::windows::core::RuntimeType for InjectedInputMouseInfo { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.Input.Preview.Injection.InjectedInputMouseInfo;{96f56e6b-e47a-5cf4-418d-8a5fb9670c7d})"); } unsafe impl ::windows::core::Interface for InjectedInputMouseInfo { type Vtable = IInjectedInputMouseInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x96f56e6b_e47a_5cf4_418d_8a5fb9670c7d); } impl ::windows::core::RuntimeName for InjectedInputMouseInfo { const NAME: &'static str = "Windows.UI.Input.Preview.Injection.InjectedInputMouseInfo"; } impl ::core::convert::From<InjectedInputMouseInfo> for ::windows::core::IUnknown { fn from(value: InjectedInputMouseInfo) -> Self { value.0 .0 } } impl ::core::convert::From<&InjectedInputMouseInfo> for ::windows::core::IUnknown { fn from(value: &InjectedInputMouseInfo) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for InjectedInputMouseInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a InjectedInputMouseInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<InjectedInputMouseInfo> for ::windows::core::IInspectable { fn from(value: InjectedInputMouseInfo) -> Self { value.0 } } impl ::core::convert::From<&InjectedInputMouseInfo> for ::windows::core::IInspectable { fn from(value: &InjectedInputMouseInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for InjectedInputMouseInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a InjectedInputMouseInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputMouseOptions(pub u32); impl InjectedInputMouseOptions { pub const None: InjectedInputMouseOptions = InjectedInputMouseOptions(0u32); pub const Move: InjectedInputMouseOptions = InjectedInputMouseOptions(1u32); pub const LeftDown: InjectedInputMouseOptions = InjectedInputMouseOptions(2u32); pub const LeftUp: InjectedInputMouseOptions = InjectedInputMouseOptions(4u32); pub const RightDown: InjectedInputMouseOptions = InjectedInputMouseOptions(8u32); pub const RightUp: InjectedInputMouseOptions = InjectedInputMouseOptions(16u32); pub const MiddleDown: InjectedInputMouseOptions = InjectedInputMouseOptions(32u32); pub const MiddleUp: InjectedInputMouseOptions = InjectedInputMouseOptions(64u32); pub const XDown: InjectedInputMouseOptions = InjectedInputMouseOptions(128u32); pub const XUp: InjectedInputMouseOptions = InjectedInputMouseOptions(256u32); pub const Wheel: InjectedInputMouseOptions = InjectedInputMouseOptions(2048u32); pub const HWheel: InjectedInputMouseOptions = InjectedInputMouseOptions(4096u32); pub const MoveNoCoalesce: InjectedInputMouseOptions = InjectedInputMouseOptions(8192u32); pub const VirtualDesk: InjectedInputMouseOptions = InjectedInputMouseOptions(16384u32); pub const Absolute: InjectedInputMouseOptions = InjectedInputMouseOptions(32768u32); } impl ::core::convert::From<u32> for InjectedInputMouseOptions { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputMouseOptions { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputMouseOptions { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputMouseOptions;u4)"); } impl ::windows::core::DefaultType for InjectedInputMouseOptions { type DefaultType = Self; } impl ::core::ops::BitOr for InjectedInputMouseOptions { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for InjectedInputMouseOptions { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for InjectedInputMouseOptions { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for InjectedInputMouseOptions { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for InjectedInputMouseOptions { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputPenButtons(pub u32); impl InjectedInputPenButtons { pub const None: InjectedInputPenButtons = InjectedInputPenButtons(0u32); pub const Barrel: InjectedInputPenButtons = InjectedInputPenButtons(1u32); pub const Inverted: InjectedInputPenButtons = InjectedInputPenButtons(2u32); pub const Eraser: InjectedInputPenButtons = InjectedInputPenButtons(4u32); } impl ::core::convert::From<u32> for InjectedInputPenButtons { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputPenButtons { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputPenButtons { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputPenButtons;u4)"); } impl ::windows::core::DefaultType for InjectedInputPenButtons { type DefaultType = Self; } impl ::core::ops::BitOr for InjectedInputPenButtons { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for InjectedInputPenButtons { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for InjectedInputPenButtons { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for InjectedInputPenButtons { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for InjectedInputPenButtons { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct InjectedInputPenInfo(pub ::windows::core::IInspectable); impl InjectedInputPenInfo { pub fn new() -> ::windows::core::Result<Self> { Self::IActivationFactory(|f| f.activate_instance::<Self>()) } fn IActivationFactory<R, F: FnOnce(&::windows::core::IActivationFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InjectedInputPenInfo, ::windows::core::IActivationFactory> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn PointerInfo(&self) -> ::windows::core::Result<InjectedInputPointerInfo> { let this = self; unsafe { let mut result__: InjectedInputPointerInfo = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputPointerInfo>(result__) } } pub fn SetPointerInfo<'a, Param0: ::windows::core::IntoParam<'a, InjectedInputPointerInfo>>(&self, value: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), value.into_param().abi()).ok() } } pub fn PenButtons(&self) -> ::windows::core::Result<InjectedInputPenButtons> { let this = self; unsafe { let mut result__: InjectedInputPenButtons = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputPenButtons>(result__) } } pub fn SetPenButtons(&self, value: InjectedInputPenButtons) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), value).ok() } } pub fn PenParameters(&self) -> ::windows::core::Result<InjectedInputPenParameters> { let this = self; unsafe { let mut result__: InjectedInputPenParameters = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputPenParameters>(result__) } } pub fn SetPenParameters(&self, value: InjectedInputPenParameters) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), value).ok() } } pub fn Pressure(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetPressure(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), value).ok() } } pub fn Rotation(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetRotation(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).15)(::core::mem::transmute_copy(this), value).ok() } } pub fn TiltX(&self) -> ::windows::core::Result<i32> { let this = self; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).16)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } pub fn SetTiltX(&self, value: i32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).17)(::core::mem::transmute_copy(this), value).ok() } } pub fn TiltY(&self) -> ::windows::core::Result<i32> { let this = self; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).18)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } pub fn SetTiltY(&self, value: i32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).19)(::core::mem::transmute_copy(this), value).ok() } } } unsafe impl ::windows::core::RuntimeType for InjectedInputPenInfo { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.Input.Preview.Injection.InjectedInputPenInfo;{6b40ad03-ca1e-5527-7e02-2828540bb1d4})"); } unsafe impl ::windows::core::Interface for InjectedInputPenInfo { type Vtable = IInjectedInputPenInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6b40ad03_ca1e_5527_7e02_2828540bb1d4); } impl ::windows::core::RuntimeName for InjectedInputPenInfo { const NAME: &'static str = "Windows.UI.Input.Preview.Injection.InjectedInputPenInfo"; } impl ::core::convert::From<InjectedInputPenInfo> for ::windows::core::IUnknown { fn from(value: InjectedInputPenInfo) -> Self { value.0 .0 } } impl ::core::convert::From<&InjectedInputPenInfo> for ::windows::core::IUnknown { fn from(value: &InjectedInputPenInfo) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for InjectedInputPenInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a InjectedInputPenInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<InjectedInputPenInfo> for ::windows::core::IInspectable { fn from(value: InjectedInputPenInfo) -> Self { value.0 } } impl ::core::convert::From<&InjectedInputPenInfo> for ::windows::core::IInspectable { fn from(value: &InjectedInputPenInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for InjectedInputPenInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a InjectedInputPenInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputPenParameters(pub u32); impl InjectedInputPenParameters { pub const None: InjectedInputPenParameters = InjectedInputPenParameters(0u32); pub const Pressure: InjectedInputPenParameters = InjectedInputPenParameters(1u32); pub const Rotation: InjectedInputPenParameters = InjectedInputPenParameters(2u32); pub const TiltX: InjectedInputPenParameters = InjectedInputPenParameters(4u32); pub const TiltY: InjectedInputPenParameters = InjectedInputPenParameters(8u32); } impl ::core::convert::From<u32> for InjectedInputPenParameters { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputPenParameters { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputPenParameters { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputPenParameters;u4)"); } impl ::windows::core::DefaultType for InjectedInputPenParameters { type DefaultType = Self; } impl ::core::ops::BitOr for InjectedInputPenParameters { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for InjectedInputPenParameters { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for InjectedInputPenParameters { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for InjectedInputPenParameters { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for InjectedInputPenParameters { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct InjectedInputPoint { pub PositionX: i32, pub PositionY: i32, } impl InjectedInputPoint {} impl ::core::default::Default for InjectedInputPoint { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for InjectedInputPoint { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("InjectedInputPoint").field("PositionX", &self.PositionX).field("PositionY", &self.PositionY).finish() } } impl ::core::cmp::PartialEq for InjectedInputPoint { fn eq(&self, other: &Self) -> bool { self.PositionX == other.PositionX && self.PositionY == other.PositionY } } impl ::core::cmp::Eq for InjectedInputPoint {} unsafe impl ::windows::core::Abi for InjectedInputPoint { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputPoint { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"struct(Windows.UI.Input.Preview.Injection.InjectedInputPoint;i4;i4)"); } impl ::windows::core::DefaultType for InjectedInputPoint { type DefaultType = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct InjectedInputPointerInfo { pub PointerId: u32, pub PointerOptions: InjectedInputPointerOptions, pub PixelLocation: InjectedInputPoint, pub TimeOffsetInMilliseconds: u32, pub PerformanceCount: u64, } impl InjectedInputPointerInfo {} impl ::core::default::Default for InjectedInputPointerInfo { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for InjectedInputPointerInfo { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("InjectedInputPointerInfo").field("PointerId", &self.PointerId).field("PointerOptions", &self.PointerOptions).field("PixelLocation", &self.PixelLocation).field("TimeOffsetInMilliseconds", &self.TimeOffsetInMilliseconds).field("PerformanceCount", &self.PerformanceCount).finish() } } impl ::core::cmp::PartialEq for InjectedInputPointerInfo { fn eq(&self, other: &Self) -> bool { self.PointerId == other.PointerId && self.PointerOptions == other.PointerOptions && self.PixelLocation == other.PixelLocation && self.TimeOffsetInMilliseconds == other.TimeOffsetInMilliseconds && self.PerformanceCount == other.PerformanceCount } } impl ::core::cmp::Eq for InjectedInputPointerInfo {} unsafe impl ::windows::core::Abi for InjectedInputPointerInfo { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputPointerInfo { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"struct(Windows.UI.Input.Preview.Injection.InjectedInputPointerInfo;u4;enum(Windows.UI.Input.Preview.Injection.InjectedInputPointerOptions;u4);struct(Windows.UI.Input.Preview.Injection.InjectedInputPoint;i4;i4);u4;u8)"); } impl ::windows::core::DefaultType for InjectedInputPointerInfo { type DefaultType = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputPointerOptions(pub u32); impl InjectedInputPointerOptions { pub const None: InjectedInputPointerOptions = InjectedInputPointerOptions(0u32); pub const New: InjectedInputPointerOptions = InjectedInputPointerOptions(1u32); pub const InRange: InjectedInputPointerOptions = InjectedInputPointerOptions(2u32); pub const InContact: InjectedInputPointerOptions = InjectedInputPointerOptions(4u32); pub const FirstButton: InjectedInputPointerOptions = InjectedInputPointerOptions(16u32); pub const SecondButton: InjectedInputPointerOptions = InjectedInputPointerOptions(32u32); pub const Primary: InjectedInputPointerOptions = InjectedInputPointerOptions(8192u32); pub const Confidence: InjectedInputPointerOptions = InjectedInputPointerOptions(16384u32); pub const Canceled: InjectedInputPointerOptions = InjectedInputPointerOptions(32768u32); pub const PointerDown: InjectedInputPointerOptions = InjectedInputPointerOptions(65536u32); pub const Update: InjectedInputPointerOptions = InjectedInputPointerOptions(131072u32); pub const PointerUp: InjectedInputPointerOptions = InjectedInputPointerOptions(262144u32); pub const CaptureChanged: InjectedInputPointerOptions = InjectedInputPointerOptions(2097152u32); } impl ::core::convert::From<u32> for InjectedInputPointerOptions { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputPointerOptions { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputPointerOptions { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputPointerOptions;u4)"); } impl ::windows::core::DefaultType for InjectedInputPointerOptions { type DefaultType = Self; } impl ::core::ops::BitOr for InjectedInputPointerOptions { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for InjectedInputPointerOptions { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for InjectedInputPointerOptions { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for InjectedInputPointerOptions { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for InjectedInputPointerOptions { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct InjectedInputRectangle { pub Left: i32, pub Top: i32, pub Bottom: i32, pub Right: i32, } impl InjectedInputRectangle {} impl ::core::default::Default for InjectedInputRectangle { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for InjectedInputRectangle { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("InjectedInputRectangle").field("Left", &self.Left).field("Top", &self.Top).field("Bottom", &self.Bottom).field("Right", &self.Right).finish() } } impl ::core::cmp::PartialEq for InjectedInputRectangle { fn eq(&self, other: &Self) -> bool { self.Left == other.Left && self.Top == other.Top && self.Bottom == other.Bottom && self.Right == other.Right } } impl ::core::cmp::Eq for InjectedInputRectangle {} unsafe impl ::windows::core::Abi for InjectedInputRectangle { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputRectangle { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"struct(Windows.UI.Input.Preview.Injection.InjectedInputRectangle;i4;i4;i4;i4)"); } impl ::windows::core::DefaultType for InjectedInputRectangle { type DefaultType = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputShortcut(pub i32); impl InjectedInputShortcut { pub const Back: InjectedInputShortcut = InjectedInputShortcut(0i32); pub const Start: InjectedInputShortcut = InjectedInputShortcut(1i32); pub const Search: InjectedInputShortcut = InjectedInputShortcut(2i32); } impl ::core::convert::From<i32> for InjectedInputShortcut { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputShortcut { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputShortcut { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputShortcut;i4)"); } impl ::windows::core::DefaultType for InjectedInputShortcut { type DefaultType = Self; } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct InjectedInputTouchInfo(pub ::windows::core::IInspectable); impl InjectedInputTouchInfo { pub fn new() -> ::windows::core::Result<Self> { Self::IActivationFactory(|f| f.activate_instance::<Self>()) } fn IActivationFactory<R, F: FnOnce(&::windows::core::IActivationFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InjectedInputTouchInfo, ::windows::core::IActivationFactory> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn Contact(&self) -> ::windows::core::Result<InjectedInputRectangle> { let this = self; unsafe { let mut result__: InjectedInputRectangle = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputRectangle>(result__) } } pub fn SetContact<'a, Param0: ::windows::core::IntoParam<'a, InjectedInputRectangle>>(&self, value: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), value.into_param().abi()).ok() } } pub fn Orientation(&self) -> ::windows::core::Result<i32> { let this = self; unsafe { let mut result__: i32 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), &mut result__).from_abi::<i32>(result__) } } pub fn SetOrientation(&self, value: i32) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), value).ok() } } pub fn PointerInfo(&self) -> ::windows::core::Result<InjectedInputPointerInfo> { let this = self; unsafe { let mut result__: InjectedInputPointerInfo = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputPointerInfo>(result__) } } pub fn SetPointerInfo<'a, Param0: ::windows::core::IntoParam<'a, InjectedInputPointerInfo>>(&self, value: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), value.into_param().abi()).ok() } } pub fn Pressure(&self) -> ::windows::core::Result<f64> { let this = self; unsafe { let mut result__: f64 = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), &mut result__).from_abi::<f64>(result__) } } pub fn SetPressure(&self, value: f64) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this), value).ok() } } pub fn TouchParameters(&self) -> ::windows::core::Result<InjectedInputTouchParameters> { let this = self; unsafe { let mut result__: InjectedInputTouchParameters = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InjectedInputTouchParameters>(result__) } } pub fn SetTouchParameters(&self, value: InjectedInputTouchParameters) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).15)(::core::mem::transmute_copy(this), value).ok() } } } unsafe impl ::windows::core::RuntimeType for InjectedInputTouchInfo { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.Input.Preview.Injection.InjectedInputTouchInfo;{224fd1df-43e8-5ef5-510a-69ca8c9b4c28})"); } unsafe impl ::windows::core::Interface for InjectedInputTouchInfo { type Vtable = IInjectedInputTouchInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x224fd1df_43e8_5ef5_510a_69ca8c9b4c28); } impl ::windows::core::RuntimeName for InjectedInputTouchInfo { const NAME: &'static str = "Windows.UI.Input.Preview.Injection.InjectedInputTouchInfo"; } impl ::core::convert::From<InjectedInputTouchInfo> for ::windows::core::IUnknown { fn from(value: InjectedInputTouchInfo) -> Self { value.0 .0 } } impl ::core::convert::From<&InjectedInputTouchInfo> for ::windows::core::IUnknown { fn from(value: &InjectedInputTouchInfo) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for InjectedInputTouchInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a InjectedInputTouchInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<InjectedInputTouchInfo> for ::windows::core::IInspectable { fn from(value: InjectedInputTouchInfo) -> Self { value.0 } } impl ::core::convert::From<&InjectedInputTouchInfo> for ::windows::core::IInspectable { fn from(value: &InjectedInputTouchInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for InjectedInputTouchInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a InjectedInputTouchInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputTouchParameters(pub u32); impl InjectedInputTouchParameters { pub const None: InjectedInputTouchParameters = InjectedInputTouchParameters(0u32); pub const Contact: InjectedInputTouchParameters = InjectedInputTouchParameters(1u32); pub const Orientation: InjectedInputTouchParameters = InjectedInputTouchParameters(2u32); pub const Pressure: InjectedInputTouchParameters = InjectedInputTouchParameters(4u32); } impl ::core::convert::From<u32> for InjectedInputTouchParameters { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputTouchParameters { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputTouchParameters { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputTouchParameters;u4)"); } impl ::windows::core::DefaultType for InjectedInputTouchParameters { type DefaultType = Self; } impl ::core::ops::BitOr for InjectedInputTouchParameters { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for InjectedInputTouchParameters { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for InjectedInputTouchParameters { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for InjectedInputTouchParameters { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for InjectedInputTouchParameters { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct InjectedInputVisualizationMode(pub i32); impl InjectedInputVisualizationMode { pub const None: InjectedInputVisualizationMode = InjectedInputVisualizationMode(0i32); pub const Default: InjectedInputVisualizationMode = InjectedInputVisualizationMode(1i32); pub const Indirect: InjectedInputVisualizationMode = InjectedInputVisualizationMode(2i32); } impl ::core::convert::From<i32> for InjectedInputVisualizationMode { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for InjectedInputVisualizationMode { type Abi = Self; } unsafe impl ::windows::core::RuntimeType for InjectedInputVisualizationMode { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"enum(Windows.UI.Input.Preview.Injection.InjectedInputVisualizationMode;i4)"); } impl ::windows::core::DefaultType for InjectedInputVisualizationMode { type DefaultType = Self; } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct InputInjector(pub ::windows::core::IInspectable); impl InputInjector { #[cfg(feature = "Foundation_Collections")] pub fn InjectKeyboardInput<'a, Param0: ::windows::core::IntoParam<'a, super::super::super::super::Foundation::Collections::IIterable<InjectedInputKeyboardInfo>>>(&self, input: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), input.into_param().abi()).ok() } } #[cfg(feature = "Foundation_Collections")] pub fn InjectMouseInput<'a, Param0: ::windows::core::IntoParam<'a, super::super::super::super::Foundation::Collections::IIterable<InjectedInputMouseInfo>>>(&self, input: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), input.into_param().abi()).ok() } } pub fn InitializeTouchInjection(&self, visualmode: InjectedInputVisualizationMode) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this), visualmode).ok() } } #[cfg(feature = "Foundation_Collections")] pub fn InjectTouchInput<'a, Param0: ::windows::core::IntoParam<'a, super::super::super::super::Foundation::Collections::IIterable<InjectedInputTouchInfo>>>(&self, input: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).9)(::core::mem::transmute_copy(this), input.into_param().abi()).ok() } } pub fn UninitializeTouchInjection(&self) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).10)(::core::mem::transmute_copy(this)).ok() } } pub fn InitializePenInjection(&self, visualmode: InjectedInputVisualizationMode) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).11)(::core::mem::transmute_copy(this), visualmode).ok() } } pub fn InjectPenInput<'a, Param0: ::windows::core::IntoParam<'a, InjectedInputPenInfo>>(&self, input: Param0) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).12)(::core::mem::transmute_copy(this), input.into_param().abi()).ok() } } pub fn UninitializePenInjection(&self) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).13)(::core::mem::transmute_copy(this)).ok() } } pub fn InjectShortcut(&self, shortcut: InjectedInputShortcut) -> ::windows::core::Result<()> { let this = self; unsafe { (::windows::core::Interface::vtable(this).14)(::core::mem::transmute_copy(this), shortcut).ok() } } pub fn TryCreate() -> ::windows::core::Result<InputInjector> { Self::IInputInjectorStatics(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InputInjector>(result__) }) } pub fn InitializeGamepadInjection(&self) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<IInputInjector2>(self)?; unsafe { (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this)).ok() } } pub fn InjectGamepadInput<'a, Param0: ::windows::core::IntoParam<'a, InjectedInputGamepadInfo>>(&self, input: Param0) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<IInputInjector2>(self)?; unsafe { (::windows::core::Interface::vtable(this).7)(::core::mem::transmute_copy(this), input.into_param().abi()).ok() } } pub fn UninitializeGamepadInjection(&self) -> ::windows::core::Result<()> { let this = &::windows::core::Interface::cast::<IInputInjector2>(self)?; unsafe { (::windows::core::Interface::vtable(this).8)(::core::mem::transmute_copy(this)).ok() } } pub fn TryCreateForAppBroadcastOnly() -> ::windows::core::Result<InputInjector> { Self::IInputInjectorStatics2(|this| unsafe { let mut result__: ::windows::core::RawPtr = ::core::mem::zeroed(); (::windows::core::Interface::vtable(this).6)(::core::mem::transmute_copy(this), &mut result__).from_abi::<InputInjector>(result__) }) } pub fn IInputInjectorStatics<R, F: FnOnce(&IInputInjectorStatics) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InputInjector, IInputInjectorStatics> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } pub fn IInputInjectorStatics2<R, F: FnOnce(&IInputInjectorStatics2) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> { static mut SHARED: ::windows::core::FactoryCache<InputInjector, IInputInjectorStatics2> = ::windows::core::FactoryCache::new(); unsafe { SHARED.call(callback) } } } unsafe impl ::windows::core::RuntimeType for InputInjector { const SIGNATURE: ::windows::core::ConstBuffer = ::windows::core::ConstBuffer::from_slice(b"rc(Windows.UI.Input.Preview.Injection.InputInjector;{8ec26f84-0b02-4bd2-ad7a-3d4658be3e18})"); } unsafe impl ::windows::core::Interface for InputInjector { type Vtable = IInputInjector_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x8ec26f84_0b02_4bd2_ad7a_3d4658be3e18); } impl ::windows::core::RuntimeName for InputInjector { const NAME: &'static str = "Windows.UI.Input.Preview.Injection.InputInjector"; } impl ::core::convert::From<InputInjector> for ::windows::core::IUnknown { fn from(value: InputInjector) -> Self { value.0 .0 } } impl ::core::convert::From<&InputInjector> for ::windows::core::IUnknown { fn from(value: &InputInjector) -> Self { value.0 .0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for InputInjector { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0 .0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a InputInjector { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0 .0) } } impl ::core::convert::From<InputInjector> for ::windows::core::IInspectable { fn from(value: InputInjector) -> Self { value.0 } } impl ::core::convert::From<&InputInjector> for ::windows::core::IInspectable { fn from(value: &InputInjector) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for InputInjector { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IInspectable> for &'a InputInjector { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IInspectable> { ::windows::core::Param::Borrowed(&self.0) } }
#[doc(hidden)] #[macro_export] macro_rules! declare_comp_field_accessor {( attrs=[ $($extra_attrs:meta),* $(,)* ] ) => ( /// A compressed field accessor,represented as 3 bits inside of a CompTLField. #[repr(transparent)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] $(#[ $extra_attrs ])* pub struct CompFieldAccessor(u8); /// The type that CompFieldAccessor is represented as. pub type CompFieldAccessorRepr=u8; impl CompFieldAccessor{ /// Equivalent to the `FieldAccessor::Direct` variant. pub const DIRECT:Self=CompFieldAccessor(0); /// Equivalent to the `FieldAccessor::Method` variant. pub const METHOD:Self=CompFieldAccessor(1); /// Equivalent to the `FieldAccessor::MethodNamed` variant, /// in which the name is stored within SharedVars after the /// name of the field this is an accessor for. pub const METHOD_NAMED:Self=CompFieldAccessor(2); /// Equivalent to the `FieldAccessor::MethodOption` variant. pub const METHOD_OPTION:Self=CompFieldAccessor(3); /// Equivalent to the `FieldAccessor::Opaque` variant. pub const OPAQUE:Self=CompFieldAccessor(4); } impl CompFieldAccessor{ const MASK:u8=0b111; /// The amount of bits used to represent a CompFieldAccessor. pub const BIT_SIZE:u32=3; /// Converts this `CompFieldAccessor` into its representation. pub const fn to_u3(self)->u8{ self.0&Self::MASK } /// Constructs this `CompFieldAccessor` from its representation. pub const fn from_u3(n:u8)->Self{ CompFieldAccessor(n&Self::MASK) } pub(crate) const fn requires_payload(self)->bool{ matches!(self, Self::METHOD_NAMED) } } )}
use chrono::prelude::*; use chrono::offset::LocalResult; pub fn sekarang() { let utc: DateTime<Utc> = Utc::now(); println!("{:?}", utc); let dt: DateTime<Local> = Local::now(); println!("{:?}", dt); let dt1 = Utc.ymd(10, 1, 1).and_hms(10, 10, 5); println!("{:?}", dt1); }
use crate::{ expression::{Expression, Literal}, statement::Declaration, Identifier, Node, NodeKind, SourceLocation, }; #[derive(Debug)] pub enum ModuleDeclaration { Import(ImportDeclaration), Export(ExportDeclaration), } impl Node for ModuleDeclaration { fn loc(&self) -> SourceLocation { match self { ModuleDeclaration::Import(ref inner) => inner.loc(), ModuleDeclaration::Export(ref inner) => inner.loc(), } } fn kind(&self) -> NodeKind { match self { ModuleDeclaration::Import(ref inner) => inner.kind(), ModuleDeclaration::Export(ref inner) => inner.kind(), } } } #[inherit(Node)] #[derive(Debug)] pub struct ImportDeclaration { pub specifiers: Vec<ImportSpecifier>, } #[derive(Debug)] pub enum ImportSpecifier { Named(Import), Default(ImportDefault), NameSpace(ImportNamespace), } #[inherit(ImportSpecifier)] #[derive(Debug)] pub struct Import { pub import: Identifier, } #[inherit(ImportSpecifier)] #[derive(Debug)] pub struct ImportDefault {} #[inherit(ImportSpecifier)] #[derive(Debug)] pub struct ImportNamespace {} #[derive(Debug)] pub enum ExportDeclaration { Named(ExportNamed), Default(ExportDefault), All(ExportAll), } impl Node for ExportDeclaration { fn loc(&self) -> SourceLocation { match self { ExportDeclaration::Named(ref inner) => inner.loc(), ExportDeclaration::Default(ref inner) => inner.loc(), ExportDeclaration::All(ref inner) => inner.loc(), } } fn kind(&self) -> NodeKind { match self { ExportDeclaration::Named(ref inner) => inner.kind(), ExportDeclaration::Default(ref inner) => inner.kind(), ExportDeclaration::All(ref inner) => inner.kind(), } } } #[inherit(Declaration)] #[derive(Debug)] pub struct ExportNamed { pub declaration: Option<Declaration>, pub specifiers: Vec<ExportSpecifier>, pub source: Option<Literal>, pub exported: Identifier, } #[inherit(Node)] #[derive(Debug)] pub struct ExportSpecifier { pub exported: Identifier, } #[inherit(Declaration)] #[derive(Debug)] pub struct ExportDefault { pub declaration: ExportDecl, } #[inherit(Declaration)] #[derive(Debug)] pub struct ExportAll { pub source: Literal, } #[derive(Debug)] pub enum ExportDecl { Decl(Declaration), Expr(Expression), }
//! Tokenizer use core::iter::Peekable; /// Token #[derive(Debug, Copy, Clone, PartialEq)] pub enum Token { /// like 1.0 Number(f64), /// `(` ParenOpen, /// `)` ParenClose, /// `+` Add, /// `-` Sub, /// `*` Mul, /// `/` Div, /// `**` Pow, /// Space Space, /// end-of-line like `\n`, `\r\n`, or EOF EOL, } /// Tokenizer #[derive(Debug, Clone, PartialEq)] pub struct Tokenizer { /// vertical position, 0-index pub col: usize, /// horizontal position, 0-index pub row: usize, } #[derive(Debug, Clone, PartialEq)] pub enum TokenizeErrorKind { UnexpectedChar(char), InvalidNumberFormat, IsolatedCarriageReturn, } #[derive(Debug, Clone, PartialEq)] pub struct TokenizeError { /// error kind pub kind: TokenizeErrorKind, /// vertical position, 0-index pub col: usize, /// horizontal position, 0-index pub row: usize, } impl Tokenizer { /// create new `Tokenizer` instance /// /// # Example /// /// ```rust /// # use recursive_syntax_parser_practice::tokenizer::Tokenizer; /// let _t = Tokenizer::new(); /// ``` pub fn new() -> Tokenizer { Tokenizer { col: 0, row: 0 } } /// calculate next token /// /// # Example /// /// ```rust /// # use recursive_syntax_parser_practice::tokenizer::{Tokenizer, Token}; /// let mut s = "(1 +.2)**2.5".chars().peekable(); /// let mut t = Tokenizer::new(); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::ParenOpen); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::Number(1.0)); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::Space); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::Add); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::Number(0.2)); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::ParenClose); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::Pow); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::Number(2.5)); /// assert_eq!(t.next_token(&mut s).unwrap(), Token::EOL); /// ``` pub fn next_token<I>(&mut self, chars: &mut Peekable<I>) -> Result<Token, TokenizeError> where I: Iterator<Item = char>, { match chars.peek() { Some(&ch) => match ch { '(' => self.consume_and_return(chars, Token::ParenOpen), ')' => self.consume_and_return(chars, Token::ParenClose), '+' => self.consume_and_return(chars, Token::Add), '-' => self.consume_and_return(chars, Token::Sub), '/' => self.consume_and_return(chars, Token::Div), '*' => { self.consume(chars); match chars.peek() { Some('*') => self.consume_and_return(chars, Token::Pow), _ => Ok(Token::Mul), } } ' ' => self.consume_and_return(chars, Token::Space), '\r' => { self.consume(chars); match chars.peek() { Some('\n') => self.consume_and_newline(chars), _ => self.error(TokenizeErrorKind::IsolatedCarriageReturn), } } '\n' => self.consume_and_newline(chars), '0'..='9' | '.' => { let mut s = String::with_capacity(1); s.push(ch); self.consume(chars); while let Some(&ch) = chars.peek() { match ch { '0'..='9' | '.' => { self.consume(chars); s.push(ch); } _ => break, } } match s.parse() { Ok(n) => Ok(Token::Number(n)), Err(_) => self.error(TokenizeErrorKind::InvalidNumberFormat), } } ch => self.error(TokenizeErrorKind::UnexpectedChar(ch)), }, None => Ok(Token::EOL), } } fn consume_and_newline<I: Iterator>(&mut self, it: &mut I) -> Result<Token, TokenizeError> { self.col = 0; self.row += 1; it.next(); Ok(Token::EOL) } fn consume<I: Iterator>(&mut self, it: &mut I) { self.col += 1; it.next(); } fn consume_and_return<I: Iterator>( &mut self, it: &mut I, token: Token, ) -> Result<Token, TokenizeError> { self.col += 1; it.next(); Ok(token) } fn error(&self, kind: TokenizeErrorKind) -> Result<Token, TokenizeError> { Err(TokenizeError { kind, row: self.row, col: self.col, }) } } impl Default for Tokenizer { fn default() -> Tokenizer { Tokenizer::new() } } #[cfg(test)] mod tests { use super::*; use core::str::Chars; fn chars(s: &str) -> Peekable<Chars> { s.chars().peekable() } #[test] fn tokenize_operation() { let s = "+-/** *()\n("; let mut chars = chars(s); let mut t = Tokenizer::new(); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Add); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Sub); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Div); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Pow); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Space); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Mul); assert_eq!(t.next_token(&mut chars).unwrap(), Token::ParenOpen); assert_eq!(t.next_token(&mut chars).unwrap(), Token::ParenClose); assert_eq!(t.next_token(&mut chars).unwrap(), Token::EOL); assert_eq!(t.next_token(&mut chars).unwrap(), Token::ParenOpen); assert_eq!(t.next_token(&mut chars).unwrap(), Token::EOL); } #[test] fn tokenize_number() { let s = "1 2.5 .25"; let mut chars = chars(s); let mut t = Tokenizer::new(); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Number(1.0)); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Space); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Number(2.5)); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Space); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Number(0.25)); assert_eq!(t.next_token(&mut chars).unwrap(), Token::EOL); } #[test] fn unexpected_token() { let s = "1 **3 @ "; let mut chars = chars(s); let mut t = Tokenizer::new(); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Number(1.0)); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Space); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Pow); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Number(3.0)); assert_eq!(t.next_token(&mut chars).unwrap(), Token::Space); let e = t.next_token(&mut chars).unwrap_err(); assert_eq!(e.kind, TokenizeErrorKind::UnexpectedChar('@')); assert_eq!(e.row, 0); assert_eq!(e.col, 6); } #[test] fn invalid_number() { let s = "\r\n1.1.1"; let mut chars = chars(s); let mut t = Tokenizer::new(); assert_eq!(t.next_token(&mut chars).unwrap(), Token::EOL); let e = t.next_token(&mut chars).unwrap_err(); assert_eq!(e.kind, TokenizeErrorKind::InvalidNumberFormat); assert_eq!(e.row, 1); assert_eq!(e.col, 5); } }
use crate::classfile::attr_info::{LineNumber, TargetInfo, TypeAnnotation}; use crate::classfile::{ attr_info::{self, AttrTag, AttrType}, constant_pool::*, field_info::FieldInfo, method_info::MethodInfo, ClassFile, Version, }; use crate::types::*; use bytes::Buf; use std::io::{Cursor, Read}; //use std::path::Path; use std::sync::Arc; struct Parser { buf: Cursor<Vec<U1>>, } impl Parser { fn new(raw: Vec<U1>) -> Self { Self { buf: Cursor::new(raw), } } } impl Parser { fn parse(&mut self) -> ClassFile { let magic = self.get_magic(); assert_eq!(magic, 0xCAFEBABE); let version = self.get_version(); info!("class version={:?}", version); let cp_count = self.get_cp_count(); let cp = self.get_cp(cp_count); let acc_flags = self.get_acc_flags(); let this_class = self.get_this_class(); let super_class = self.get_super_class(); let interfaces_count = self.get_interface_count(); let interfaces = self.get_interfaces(interfaces_count); let fields_count = self.get_fields_count(); let fields = self.get_fields(fields_count, &cp); let methods_count = self.get_methods_count(); let methods = self.get_methods(methods_count, &cp); let attrs_count = self.get_attrs_count(); let attrs = self.get_attrs(attrs_count, &cp); // info!("class attrs = {:?}", attrs); ClassFile { magic, version, cp_count, cp, acc_flags, this_class, super_class, interfaces_count, interfaces, fields_count, fields, methods_count, methods, attrs_count, attrs, } } fn get_u4(&mut self) -> U4 { self.buf.get_u32() } fn get_u2(&mut self) -> U2 { self.buf.get_u16() } fn get_u1(&mut self) -> U1 { self.buf.get_u8() } fn get_u1s(&mut self, len: usize) -> Vec<U1> { let mut bytes = Vec::with_capacity(len); bytes.resize(len, 0); let r = self.buf.read_exact(&mut bytes); assert!(r.is_ok()); bytes } fn get_code_exceptions(&mut self, len: usize) -> Vec<attr_info::CodeException> { let mut exceptions = Vec::with_capacity(len); for _ in 0..len { let start_pc = self.get_u2(); let end_pc = self.get_u2(); let handler_pc = self.get_u2(); let catch_type = self.get_u2(); let exception = attr_info::CodeException { start_pc, end_pc, handler_pc, catch_type, }; exceptions.push(exception); } exceptions } fn get_line_nums(&mut self, len: usize) -> Vec<LineNumber> { let mut tables = Vec::with_capacity(len); for _ in 0..len { let start_pc = self.get_u2(); let number = self.get_u2(); tables.push(attr_info::LineNumber { start_pc, number }); } tables } fn get_verification_type_info(&mut self, n: usize) -> Vec<attr_info::VerificationTypeInfo> { let mut r = Vec::with_capacity(n); for _ in 0..n { let v = match self.get_u1() { 0 => attr_info::VerificationTypeInfo::Top, 1 => attr_info::VerificationTypeInfo::Integer, 2 => attr_info::VerificationTypeInfo::Float, 5 => attr_info::VerificationTypeInfo::Null, 6 => attr_info::VerificationTypeInfo::UninitializedThis, 7 => { let cpool_index = self.get_u2(); attr_info::VerificationTypeInfo::Object { cpool_index } } 8 => { let offset = self.get_u2(); attr_info::VerificationTypeInfo::Uninitialized { offset } } 4 => attr_info::VerificationTypeInfo::Long, 3 => attr_info::VerificationTypeInfo::Double, _ => unreachable!(), }; r.push(v); } r } } trait ClassFileParser { fn get_magic(&mut self) -> U4; fn get_version(&mut self) -> Version; fn get_cp_count(&mut self) -> U2; fn get_cp(&mut self, n: U2) -> ConstantPool; fn get_acc_flags(&mut self) -> U2; fn get_this_class(&mut self) -> U2; fn get_super_class(&mut self) -> U2; fn get_interface_count(&mut self) -> U2; fn get_interfaces(&mut self, n: U2) -> Vec<U2>; fn get_fields_count(&mut self) -> U2; fn get_fields(&mut self, n: U2, cp: &ConstantPool) -> Vec<FieldInfo>; fn get_methods_count(&mut self) -> U2; fn get_methods(&mut self, n: U2, cp: &ConstantPool) -> Vec<MethodInfo>; fn get_attrs_count(&mut self) -> U2; fn get_attrs(&mut self, n: U2, cp: &ConstantPool) -> Vec<AttrType>; } impl ClassFileParser for Parser { fn get_magic(&mut self) -> U4 { self.get_u4() } fn get_version(&mut self) -> Version { let minor = self.get_u2(); let major = self.get_u2(); Version { minor, major } } fn get_cp_count(&mut self) -> U2 { self.get_u2() } fn get_cp(&mut self, n: U2) -> ConstantPool { let mut v = Vec::new(); v.push(ConstantType::Nop); let mut i = 1; while i < n { let tag = self.get_u1(); let ct = ConstantTag::from(tag); let vv = match ct { ConstantTag::Class => self.get_constant_class(), ConstantTag::FieldRef => self.get_constant_field_ref(), ConstantTag::MethodRef => self.get_constant_method_ref(), ConstantTag::InterfaceMethodRef => self.get_constant_interface_method_ref(), ConstantTag::String => self.get_constant_string(), ConstantTag::Integer => self.get_constant_integer(), ConstantTag::Float => self.get_constant_float(), ConstantTag::Long => self.get_constant_long(), ConstantTag::Double => self.get_constant_double(), ConstantTag::NameAndType => self.get_constant_name_and_type(), ConstantTag::Utf8 => self.get_constant_utf8(), ConstantTag::MethodHandle => self.get_constant_method_handle(), ConstantTag::MethodType => self.get_constant_method_type(), ConstantTag::InvokeDynamic => self.get_constant_invoke_dynamic(), _ => unreachable!(), }; i += 1; v.push(vv); //spec 4.4.5 match ct { ConstantTag::Long | ConstantTag::Double => { i += 1; v.push(ConstantType::Nop); } _ => (), } } new_ref!(v) } fn get_acc_flags(&mut self) -> U2 { self.get_u2() } fn get_this_class(&mut self) -> U2 { self.get_u2() } fn get_super_class(&mut self) -> U2 { self.get_u2() } fn get_interface_count(&mut self) -> U2 { self.get_u2() } fn get_interfaces(&mut self, n: U2) -> Vec<U2> { let mut v = Vec::with_capacity(n as usize); for _ in 0..n { v.push(self.get_u2()) } v } fn get_fields_count(&mut self) -> U2 { self.get_u2() } fn get_fields(&mut self, n: U2, cp: &ConstantPool) -> Vec<FieldInfo> { let mut v = Vec::with_capacity(n as usize); for _ in 0..n { v.push(self.get_field(cp)) } v } fn get_methods_count(&mut self) -> U2 { self.get_u2() } fn get_methods(&mut self, n: U2, cp: &ConstantPool) -> Vec<MethodInfo> { let mut v = Vec::with_capacity(n as usize); for _ in 0..n { v.push(self.get_method(cp)); } v } fn get_attrs_count(&mut self) -> U2 { self.get_u2() } fn get_attrs(&mut self, n: U2, cp: &ConstantPool) -> Vec<AttrType> { let mut v = Vec::with_capacity(n as usize); for _ in 0..n { v.push(self.get_attr_type(cp)); } v } } trait ConstantPoolParser { fn get_constant_class(&mut self) -> ConstantType; fn get_constant_field_ref(&mut self) -> ConstantType; fn get_constant_method_ref(&mut self) -> ConstantType; fn get_constant_interface_method_ref(&mut self) -> ConstantType; fn get_constant_string(&mut self) -> ConstantType; fn get_constant_integer(&mut self) -> ConstantType; fn get_constant_float(&mut self) -> ConstantType; fn get_constant_long(&mut self) -> ConstantType; fn get_constant_double(&mut self) -> ConstantType; fn get_constant_name_and_type(&mut self) -> ConstantType; fn get_constant_utf8(&mut self) -> ConstantType; fn get_constant_method_handle(&mut self) -> ConstantType; fn get_constant_method_type(&mut self) -> ConstantType; fn get_constant_invoke_dynamic(&mut self) -> ConstantType; } impl ConstantPoolParser for Parser { fn get_constant_class(&mut self) -> ConstantType { ConstantType::Class { name_index: self.get_u2(), } } fn get_constant_field_ref(&mut self) -> ConstantType { ConstantType::FieldRef { class_index: self.get_u2(), name_and_type_index: self.get_u2(), } } fn get_constant_method_ref(&mut self) -> ConstantType { ConstantType::MethodRef { class_index: self.get_u2(), name_and_type_index: self.get_u2(), } } fn get_constant_interface_method_ref(&mut self) -> ConstantType { ConstantType::InterfaceMethodRef { class_index: self.get_u2(), name_and_type_index: self.get_u2(), } } fn get_constant_string(&mut self) -> ConstantType { ConstantType::String { string_index: self.get_u2(), } } fn get_constant_integer(&mut self) -> ConstantType { let mut v = [0; 4]; let r = self.buf.read_exact(&mut v); assert!(r.is_ok()); ConstantType::Integer { v } } fn get_constant_float(&mut self) -> ConstantType { let mut v = [0; 4]; let r = self.buf.read_exact(&mut v); assert!(r.is_ok()); ConstantType::Float { v } } fn get_constant_long(&mut self) -> ConstantType { let mut v = [0; 8]; let r = self.buf.read_exact(&mut v); assert!(r.is_ok()); ConstantType::Long { v } } fn get_constant_double(&mut self) -> ConstantType { let mut v = [0; 8]; let r = self.buf.read_exact(&mut v); assert!(r.is_ok()); ConstantType::Double { v } } fn get_constant_name_and_type(&mut self) -> ConstantType { ConstantType::NameAndType { name_index: self.get_u2(), desc_index: self.get_u2(), } } fn get_constant_utf8(&mut self) -> ConstantType { let length = self.get_u2(); let bytes = self.get_u1s(length as usize); let bytes = new_ref!(bytes); ConstantType::Utf8 { length, bytes } } fn get_constant_method_handle(&mut self) -> ConstantType { ConstantType::MethodHandle { ref_kind: self.get_u1(), ref_index: self.get_u2(), } } fn get_constant_method_type(&mut self) -> ConstantType { ConstantType::MethodType { desc_index: self.get_u2(), } } fn get_constant_invoke_dynamic(&mut self) -> ConstantType { ConstantType::InvokeDynamic { bootstrap_method_attr_index: self.get_u2(), name_and_type_index: self.get_u2(), } } } trait FieldParser { fn get_field(&mut self, cp: &ConstantPool) -> FieldInfo; } impl FieldParser for Parser { fn get_field(&mut self, cp: &ConstantPool) -> FieldInfo { let acc_flags = self.get_u2(); let name_index = self.get_u2(); let desc_index = self.get_u2(); let attrs_count = self.get_attrs_count(); let attrs = self.get_attrs(attrs_count, cp); // info!("field attrs = {:?}", attrs); FieldInfo { acc_flags, name_index, desc_index, attrs, } } } trait MethodParser { fn get_method(&mut self, cp: &ConstantPool) -> MethodInfo; } impl MethodParser for Parser { fn get_method(&mut self, cp: &ConstantPool) -> MethodInfo { let acc_flags = self.get_u2(); let name_index = self.get_u2(); let desc_index = self.get_u2(); let attrs_count = self.get_attrs_count(); let attrs = self.get_attrs(attrs_count, cp); // info!("method attrs = {:?}", attrs); MethodInfo { acc_flags, name_index, desc_index, attrs, } } } trait AttrTypeParser { fn get_attr_type(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_constant_value(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_code(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_stack_map_table(&mut self) -> AttrType; fn get_attr_exceptions(&mut self) -> AttrType; fn get_attr_inner_classes(&mut self) -> AttrType; fn get_attr_enclosing_method(&mut self) -> AttrType; fn get_attr_synthetic(&mut self) -> AttrType; fn get_attr_signature(&mut self) -> AttrType; fn get_attr_source_file(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_source_debug_ext(&mut self) -> AttrType; fn get_attr_line_num_table(&mut self) -> AttrType; fn get_attr_local_var_table(&mut self) -> AttrType; fn get_attr_local_var_type_table(&mut self) -> AttrType; fn get_attr_deprecated(&mut self) -> AttrType; fn get_attr_rt_vis_annotations(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_rt_in_vis_annotations(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_rt_vis_parameter_annotations(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_rt_in_vis_parameter_annotations(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_rt_vis_type_annotations(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_rt_in_vis_type_annotations(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_annotation_default(&mut self, cp: &ConstantPool) -> AttrType; fn get_attr_bootstrap_methods(&mut self) -> AttrType; fn get_attr_method_parameters(&mut self) -> AttrType; fn get_attr_unknown(&mut self) -> AttrType; } trait AttrTypeParserUtils { fn get_attr_util_get_annotation(&mut self, cp: &ConstantPool) -> attr_info::AnnotationEntry; fn get_attr_util_get_type_annotation(&mut self, cp: &ConstantPool) -> attr_info::TypeAnnotation; fn get_attr_util_get_target_info(&mut self, target_type: U1) -> attr_info::TargetInfo; fn get_attr_util_get_local_var(&mut self) -> attr_info::LocalVariable; fn get_attr_util_get_element_val(&mut self, cp: &ConstantPool) -> attr_info::ElementValueType; } impl AttrTypeParser for Parser { fn get_attr_type(&mut self, cp: &ConstantPool) -> AttrType { let name_index = self.get_u2(); let name = get_utf8(cp, name_index as usize).unwrap(); let tag = AttrTag::from(name.as_slice()); match tag { AttrTag::Invalid => AttrType::Invalid, AttrTag::ConstantValue => self.get_attr_constant_value(cp), AttrTag::Code => self.get_attr_code(cp), AttrTag::StackMapTable => self.get_attr_stack_map_table(), AttrTag::Exceptions => self.get_attr_exceptions(), AttrTag::InnerClasses => self.get_attr_inner_classes(), AttrTag::EnclosingMethod => self.get_attr_enclosing_method(), AttrTag::Synthetic => self.get_attr_synthetic(), AttrTag::Signature => self.get_attr_signature(), AttrTag::SourceFile => self.get_attr_source_file(cp), AttrTag::SourceDebugExtension => self.get_attr_source_debug_ext(), AttrTag::LineNumberTable => self.get_attr_line_num_table(), AttrTag::LocalVariableTable => self.get_attr_local_var_table(), AttrTag::LocalVariableTypeTable => self.get_attr_local_var_type_table(), AttrTag::Deprecated => self.get_attr_deprecated(), AttrTag::RuntimeVisibleAnnotations => self.get_attr_rt_vis_annotations(cp), AttrTag::RuntimeInvisibleAnnotations => self.get_attr_rt_in_vis_annotations(cp), AttrTag::RuntimeVisibleParameterAnnotations => { self.get_attr_rt_vis_parameter_annotations(cp) } AttrTag::RuntimeInvisibleParameterAnnotations => { self.get_attr_rt_in_vis_parameter_annotations(cp) } AttrTag::RuntimeVisibleTypeAnnotations => self.get_attr_rt_vis_type_annotations(cp), AttrTag::RuntimeInvisibleTypeAnnotations => { self.get_attr_rt_in_vis_type_annotations(cp) } AttrTag::AnnotationDefault => self.get_attr_annotation_default(cp), AttrTag::BootstrapMethods => self.get_attr_bootstrap_methods(), AttrTag::MethodParameters => self.get_attr_method_parameters(), AttrTag::Unknown => self.get_attr_unknown(), } } fn get_attr_constant_value(&mut self, cp: &ConstantPool) -> AttrType { let length = self.get_u4(); assert_eq!(length, 2); let constant_value_index = self.get_u2(); match cp.get(constant_value_index as usize) { Some(v) => match v { ConstantType::Long { v: _ } => (), //verify ok ConstantType::Float { v: _ } => (), //verify ok ConstantType::Double { v: _ } => (), //verify ok ConstantType::Integer { v: _ } => (), //verify ok ConstantType::String { string_index: _ } => (), //verify ok _ => unreachable!(), }, _ => unreachable!(), } AttrType::ConstantValue { constant_value_index, } } fn get_attr_code(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let max_stack = self.get_u2(); let max_locals = self.get_u2(); let len = self.get_u4(); let code = self.get_u1s(len as usize); let code = Arc::new(code); let n = self.get_u2(); let exceptions = self.get_code_exceptions(n as usize); let n = self.get_u2(); let mut attrs = Vec::with_capacity(n as usize); for _ in 0..n { attrs.push(self.get_attr_type(cp)); } AttrType::Code(attr_info::Code { max_stack, max_locals, code, exceptions, attrs, }) } fn get_attr_stack_map_table(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut entries = Vec::with_capacity(n as usize); for _ in 0..n { let frame_type = self.get_u1(); let v = match frame_type { 0..=63 => attr_info::StackMapFrame::Same { offset_delta: frame_type as U2, }, 64..=127 => { let offset_delta = (frame_type - 64) as U2; let mut v = self.get_verification_type_info(1); let stack = [v.remove(0)]; attr_info::StackMapFrame::SameLocals1StackItem { offset_delta, stack, } } 128..=246 => attr_info::StackMapFrame::Reserved, 247 => { let offset_delta = self.get_u2(); let mut v = self.get_verification_type_info(1); let stack = [v.remove(0)]; attr_info::StackMapFrame::SameLocals1StackItem { offset_delta, stack, } } 248..=250 => { let offset_delta = self.get_u2(); attr_info::StackMapFrame::Chop { offset_delta } } 251 => { let offset_delta = self.get_u2(); attr_info::StackMapFrame::SameExtended { offset_delta } } 252..=254 => { let offset_delta = self.get_u2(); let n = frame_type - 251; let locals = self.get_verification_type_info(n as usize); attr_info::StackMapFrame::Append { offset_delta, locals, } } 255 => { let offset_delta = self.get_u2(); let n = self.get_u2(); let locals = self.get_verification_type_info(n as usize); let n = self.get_u2(); let stack = self.get_verification_type_info(n as usize); attr_info::StackMapFrame::Full { offset_delta, locals, stack, } } }; entries.push(v); } AttrType::StackMapTable { entries } } fn get_attr_exceptions(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut exceptions = Vec::with_capacity(n as usize); for _ in 0..n { exceptions.push(self.get_u2()); } AttrType::Exceptions { exceptions } } fn get_attr_inner_classes(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut classes = Vec::with_capacity(n as usize); for _ in 0..n { let inner_class_info_index = self.get_u2(); let outer_class_info_index = self.get_u2(); let inner_name_index = self.get_u2(); let inner_class_access_flags = self.get_u2(); classes.push(attr_info::InnerClass { inner_class_info_index, outer_class_info_index, inner_name_index, inner_class_access_flags, }); } AttrType::InnerClasses { classes } } fn get_attr_enclosing_method(&mut self) -> AttrType { let length = self.get_u4(); assert_eq!(length, 4); let class_index = self.get_u2(); let method_index = self.get_u2(); let em = attr_info::EnclosingMethod { class_index, method_index, }; AttrType::EnclosingMethod { em } } fn get_attr_synthetic(&mut self) -> AttrType { let length = self.get_u4(); assert_eq!(length, 0); AttrType::Synthetic } fn get_attr_signature(&mut self) -> AttrType { let length = self.get_u4(); assert_eq!(length, 2); let signature_index = self.get_u2(); AttrType::Signature { signature_index } } fn get_attr_source_file(&mut self, _cp: &ConstantPool) -> AttrType { let length = self.get_u4(); assert_eq!(length, 2); let source_file_index = self.get_u2(); // let name = get_utf8(cp, source_file_index as usize).unwrap(); // println!("src name = {}", String::from_utf8_lossy(name.as_slice())); AttrType::SourceFile { source_file_index } } fn get_attr_source_debug_ext(&mut self) -> AttrType { let length = self.get_u4(); let debug_extension = self.get_u1s(length as usize); let debug_extension = Arc::new(debug_extension); AttrType::SourceDebugExtension { debug_extension } } fn get_attr_line_num_table(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let tables = self.get_line_nums(n as usize); AttrType::LineNumberTable { tables } } fn get_attr_local_var_table(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut tables = Vec::with_capacity(n as usize); for _ in 0..n { tables.push(self.get_attr_util_get_local_var()); } AttrType::LocalVariableTable { tables } } fn get_attr_local_var_type_table(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut tables = Vec::with_capacity(n as usize); for _ in 0..n { tables.push(self.get_attr_util_get_local_var()); } AttrType::LocalVariableTypeTable { tables } } fn get_attr_deprecated(&mut self) -> AttrType { let length = self.get_u4(); assert_eq!(length, 0); AttrType::Deprecated } fn get_attr_rt_vis_annotations(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut annotations = Vec::with_capacity(n as usize); for _ in 0..n { annotations.push(self.get_attr_util_get_annotation(cp)); } AttrType::RuntimeVisibleAnnotations { annotations } } fn get_attr_rt_in_vis_annotations(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut annotations = Vec::with_capacity(n as usize); for _ in 0..n { annotations.push(self.get_attr_util_get_annotation(cp)); } AttrType::RuntimeInvisibleAnnotations { annotations } } fn get_attr_rt_vis_parameter_annotations(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut annotations = Vec::with_capacity(n as usize); for _ in 0..n { annotations.push(self.get_attr_util_get_annotation(cp)); } AttrType::RuntimeVisibleParameterAnnotations { annotations } } fn get_attr_rt_in_vis_parameter_annotations(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut annotations = Vec::with_capacity(n as usize); for _ in 0..n { annotations.push(self.get_attr_util_get_annotation(cp)); } AttrType::RuntimeInvisibleParameterAnnotations { annotations } } fn get_attr_rt_vis_type_annotations(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut annotations = Vec::with_capacity(n as usize); for _ in 0..n { annotations.push(self.get_attr_util_get_type_annotation(cp)); } AttrType::RuntimeVisibleTypeAnnotations { annotations } } fn get_attr_rt_in_vis_type_annotations(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut annotations = Vec::with_capacity(n as usize); for _ in 0..n { annotations.push(self.get_attr_util_get_type_annotation(cp)); } AttrType::RuntimeInvisibleTypeAnnotations { annotations } } fn get_attr_annotation_default(&mut self, cp: &ConstantPool) -> AttrType { let _length = self.get_u4(); let default_value = self.get_attr_util_get_element_val(cp); AttrType::AnnotationDefault { default_value } } fn get_attr_bootstrap_methods(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u2(); let mut methods = Vec::with_capacity(n as usize); for _ in 0..n { let method_ref: U2 = self.get_u2(); let n_arg: U2 = self.get_u2(); let mut args = Vec::with_capacity(n_arg as usize); for _ in 0..n_arg { args.push(self.get_u2()); } methods.push(attr_info::BootstrapMethod { method_ref, args }); } AttrType::BootstrapMethods { n, methods } } fn get_attr_method_parameters(&mut self) -> AttrType { let _length = self.get_u4(); let n = self.get_u1(); let mut parameters = Vec::with_capacity(n as usize); for _ in 0..n { let name_index = self.get_u2(); let acc_flags = self.get_u2(); parameters.push(attr_info::MethodParameter { name_index, acc_flags, }); } AttrType::MethodParameters { parameters } } fn get_attr_unknown(&mut self) -> AttrType { let len = self.get_u4(); let _v = self.get_u1s(len as usize); AttrType::Unknown } } impl AttrTypeParserUtils for Parser { fn get_attr_util_get_annotation(&mut self, cp: &ConstantPool) -> attr_info::AnnotationEntry { let type_index = self.get_u2(); let n = self.get_u2(); let mut pairs = Vec::with_capacity(n as usize); for _ in 0..n { let name_index = self.get_u2(); let value = self.get_attr_util_get_element_val(cp); pairs.push(attr_info::ElementValuePair { name_index, value }); } let type_name = get_utf8(cp, type_index as usize).unwrap(); attr_info::AnnotationEntry { type_name, pairs } } fn get_attr_util_get_type_annotation(&mut self, cp: &ConstantPool) -> TypeAnnotation { let target_type = self.get_u1(); //Table 4.7.20 let target_info = self.get_attr_util_get_target_info(target_type); let n = self.get_u1(); let mut target_path = Vec::with_capacity(n as usize); for _ in 0..n { let type_path_kind = self.get_u1(); let type_argument_index = self.get_u1(); target_path.push(attr_info::TypePath { type_path_kind, type_argument_index, }); } let type_index = self.get_u2(); let n = self.get_u2(); let mut pairs = Vec::with_capacity(n as usize); for _ in 0..n { let name_index = self.get_u2(); let value = self.get_attr_util_get_element_val(cp); pairs.push(attr_info::ElementValuePair { name_index, value }); } attr_info::TypeAnnotation { target_type, target_info, target_path, type_index, pairs, } } fn get_attr_util_get_target_info(&mut self, target_type: U1) -> TargetInfo { match target_type { 0x00 | 0x01 => { let type_parameter_index = self.get_u1(); attr_info::TargetInfo::TypeParameter { type_parameter_index, } } 0x10 => { let supertype_index = self.get_u2(); attr_info::TargetInfo::SuperType { supertype_index } } 0x11 | 0x12 => { let type_parameter_index = self.get_u1(); let bound_index = self.get_u1(); attr_info::TargetInfo::TypeParameterBound { type_parameter_index, bound_index, } } 0x13 | 0x14 | 0x15 => attr_info::TargetInfo::Empty, 0x16 => { let formal_parameter_index = self.get_u1(); attr_info::TargetInfo::FormalParameter { formal_parameter_index, } } 0x17 => { let throws_type_index = self.get_u2(); attr_info::TargetInfo::Throws { throws_type_index } } 0x40 | 0x41 => { let n = self.get_u2(); let mut table = Vec::with_capacity(n as usize); for _ in 0..n { let start_pc = self.get_u2(); let length = self.get_u2(); let index = self.get_u2(); table.push(attr_info::LocalVarTargetTable { start_pc, length, index, }); } attr_info::TargetInfo::LocalVar { table } } 0x42 => { let exception_table_index = self.get_u2(); attr_info::TargetInfo::Catch { exception_table_index, } } 0x43 | 0x44 | 0x45 | 0x46 => { let offset = self.get_u2(); attr_info::TargetInfo::Offset { offset } } 0x47 | 0x48 | 0x49 | 0x4A | 0x4B => { let offset = self.get_u2(); let type_argument_index = self.get_u1(); attr_info::TargetInfo::TypeArgument { offset, type_argument_index, } } _ => unreachable!(), } } fn get_attr_util_get_local_var(&mut self) -> attr_info::LocalVariable { let start_pc = self.get_u2(); let length = self.get_u2(); let name_index = self.get_u2(); let signature_index = self.get_u2(); let index = self.get_u2(); attr_info::LocalVariable { start_pc, length, name_index, signature_index, index, } } fn get_attr_util_get_element_val(&mut self, cp: &ConstantPool) -> attr_info::ElementValueType { let tag = self.get_u1(); match attr_info::ElementValueTag::from(tag) { attr_info::ElementValueTag::Byte => { let val_index = self.get_u2(); attr_info::ElementValueType::Byte { tag, val_index } } attr_info::ElementValueTag::Char => { let val_index = self.get_u2(); attr_info::ElementValueType::Char { tag, val_index } } attr_info::ElementValueTag::Double => { let val_index = self.get_u2(); attr_info::ElementValueType::Double { tag, val_index } } attr_info::ElementValueTag::Float => { let val_index = self.get_u2(); attr_info::ElementValueType::Float { tag, val_index } } attr_info::ElementValueTag::Int => { let val_index = self.get_u2(); attr_info::ElementValueType::Int { tag, val_index } } attr_info::ElementValueTag::Long => { let val_index = self.get_u2(); attr_info::ElementValueType::Long { tag, val_index } } attr_info::ElementValueTag::Short => { let val_index = self.get_u2(); attr_info::ElementValueType::Short { tag, val_index } } attr_info::ElementValueTag::Boolean => { let val_index = self.get_u2(); attr_info::ElementValueType::Boolean { tag, val_index } } attr_info::ElementValueTag::String => { let val_index = self.get_u2(); attr_info::ElementValueType::String { tag, val_index } } attr_info::ElementValueTag::Enum => { let type_index = self.get_u2(); let val_index = self.get_u2(); attr_info::ElementValueType::Enum { tag, type_index, val_index, } } attr_info::ElementValueTag::Class => { let index = self.get_u2(); attr_info::ElementValueType::Class { tag, index } } attr_info::ElementValueTag::Annotation => { let value = self.get_attr_util_get_annotation(cp); let v = attr_info::AnnotationElementValue { value }; attr_info::ElementValueType::Annotation(v) } attr_info::ElementValueTag::Array => { let n = self.get_u2(); let mut values = Vec::with_capacity(n as usize); for _ in 0..n { values.push(self.get_attr_util_get_element_val(cp)); } attr_info::ElementValueType::Array { n, values } } attr_info::ElementValueTag::Unknown => attr_info::ElementValueType::Unknown, } } } /* pub fn parse<P: AsRef<Path>>(path: P) -> std::io::Result<ClassFile> { let buf = util::read(path); parse_buf(buf) } */ pub fn parse_buf(buf: Vec<u8>) -> std::io::Result<ClassFile> { let mut parser = Parser::new(buf); Ok(parser.parse()) }
use diesel; use diesel::mysql::MysqlConnection; use diesel::prelude::*; use schema::clients; #[table_name = "clients"] #[derive(Serialize, Deserialize, Queryable, Insertable, AsChangeset)] pub struct Client { pub id: i32, pub name: String, } #[table_name = "clients"] #[derive(FromForm, Deserialize, Insertable, AsChangeset)] pub struct NewClient { pub name: String, } impl Client { pub fn create(client: NewClient, connection: &MysqlConnection) -> Client { diesel::insert_into(clients::table) .values(&client) .execute(connection) .expect("Error creating new client"); clients::table .order(clients::id.desc()) .first(connection) .unwrap() } pub fn read(connection: &MysqlConnection) -> Vec<Client> { clients::table .order(clients::id.asc()) .load::<Client>(connection) .unwrap() } pub fn update(id: i32, client: Client, connection: &MysqlConnection) -> bool { diesel::update(clients::table.find(id)) .set(&client) .execute(connection) .is_ok() } pub fn delete(id: i32, connection: &MysqlConnection) -> bool { diesel::delete(clients::table.find(id)) .execute(connection) .is_ok() } }
use challenges::random_bytes; use cipher::{self, cbc::AES_128_CBC, padding, Cipher}; use rand::{self, Rng}; use std::fs; fn main() { println!("🔓 Challenge 17"); let key = Key::new(); padding_oracle_attack(&key); } fn padding_oracle_attack(key: &Key) { let ct = key.encryption_oracle(); // remember the first 16-byte is iv let mut found = false; let mut random_block = vec![]; // Explain: assuming the ciphertext is only 3 block long, if we tamper the second block c[1] and XOR // with a random block B, then the decrypted 3rd block, m'[2] = m[2] ^ B. // If m'[2] is a valid padded block, then the likihood suggests the last byte is 1, thus, we can // reverse engineer the orignial last byte of m[2], which also is the padding length value while !found { let mut ct_tampered = ct.clone(); random_block = random_bytes(16); ct_tampered.splice( ct.len() - 32..ct.len() - 16, xor::xor(&random_block, &ct[ct.len() - 32..ct.len() - 16]) .unwrap() .iter() .cloned(), ); found = key.padding_oracle(&ct_tampered); } let last_byte = random_block.last().unwrap() ^ b'\x01'; println!("Padding length is {}", last_byte); // NOTE: up until here, based on the `last_byte`, we could already narrow down the plaintext based // on their length mod 16, and even probably deduce which one out of the ten string is // encrypted, but here, we will go further and directly decrypt the entire plaintext using // padding_oracle, as if we know nothing about the plaintext let mut pt = vec![last_byte; last_byte as usize]; while pt.len() < ct.len() - 16 { let pt_len = pt.len(); let mut random_block: Vec<u8> = vec![0 as u8; 16 - pt_len % 16]; random_block.extend_from_slice( &xor::xor(&vec![(pt_len % 16 + 1) as u8; pt_len % 16], &pt[..pt_len % 16]) .unwrap() .as_slice(), ); let mut found = false; while !found { let mut ct_tampered = ct.clone(); ct_tampered.truncate(ct.len() - 16 * (pt_len / 16)); let ct_tampered_len = ct_tampered.len(); random_block.splice( ..16 - pt_len % 16, random_bytes((16 - pt_len % 16) as u32).iter().cloned(), ); ct_tampered.splice( ct_tampered_len - 32..ct_tampered_len - 16, xor::xor( &random_block, &ct_tampered.clone()[ct_tampered_len - 32..ct_tampered_len - 16], ) .unwrap() .iter() .cloned(), ); found = key.padding_oracle(&ct_tampered); } pt.insert(0, random_block.get(15 - pt_len % 16).unwrap() ^ (pt_len % 16 + 1) as u8); } println!("decrypted: {:?}", String::from_utf8(pt).unwrap()); } struct Key(Vec<u8>); impl Key { pub fn new() -> Key { Key(random_bytes(16)) } pub fn encryption_oracle(&self) -> Vec<u8> { let pt_str = fs::read_to_string("challenges/data/chal17.txt").unwrap(); let pt_candidates: Vec<_> = pt_str.lines().collect(); let mut rng = rand::thread_rng(); let pt = pt_candidates[rng.gen_range(0..pt_candidates.len())]; let cbc_cipher = AES_128_CBC::new(); cbc_cipher.encrypt(&self.0, &pt.as_bytes()) } pub fn padding_oracle(&self, ct: &[u8]) -> bool { let pt_with_padding = AES_128_CBC::decrypt_with_padding(&self.0, &ct); padding::validate_padding(&pt_with_padding, 16) } }
use std::string::String; use std::slice::SliceExt; struct Executable { cmd: &str, args: &[&str], prev: char, } impl Executable { fn new(st: String) -> Executable { let out: &[&str] = st.trim().words().collect(); let (cmd1, args1) = out.split_at(1); let exe = Executable { cmd: cmd1, args: args1 }; } }
#![deny(warnings)] pub mod ir; pub mod write; pub use self::ir::*;
use crate::errors::ServiceError; //use crate::models::fcm::{Params, ParamsToFcm}; use crate::models::msg::Msg; use crate::schema::user_device; use actix::Message; use chrono::NaiveDateTime; use serde::{Deserialize, Serialize}; use uuid::Uuid; #[derive( Clone, Debug, Serialize, Associations, Deserialize, PartialEq, Identifiable, Queryable, Insertable, )] #[table_name = "user_device"] pub struct Device { pub id: i32, pub user_id: Uuid, pub name: String, pub sw_token: String, pub created_at: NaiveDateTime, pub updated_at: Option<NaiveDateTime>, pub deleted_at: Option<NaiveDateTime>, } #[derive(Deserialize, Serialize, Debug, Message, Insertable)] #[rtype(result = "Result<Msg, ServiceError>")] #[table_name = "user_device"] pub struct Check { pub user_id: Uuid, pub name: String, pub sw_token: String, } #[derive(Deserialize, Serialize, Debug, Message, Insertable)] #[rtype(result = "Result<Msg, ServiceError>")] #[table_name = "user_device"] pub struct New { pub user_id: Uuid, pub name: String, pub sw_token: String, } #[derive(Deserialize, Serialize, Debug, Message)] #[rtype(result = "Result<Msg, ServiceError>")] pub struct GetList { pub user_id: Uuid, } #[derive(Deserialize, Serialize, Debug, Message, Clone)] #[rtype(result = "Result<GetWithShopRes, ServiceError>")] pub struct GetWithShop { pub sw_token: String, pub user_id: Uuid, } use diesel::sql_types::{BigInt, Text, Uuid as uu}; #[derive(Clone, Debug, Serialize, Deserialize, QueryableByName)] pub struct GetWithShopRes { #[sql_type = "uu"] pub shop_id: Uuid, #[sql_type = "Text"] pub notification_key: String, #[sql_type = "BigInt"] pub device_cnt: i64, #[sql_type = "Text"] pub operation: String, } /* impl GetWithShopRes { pub fn get(&self, webpush: WebPush) -> Option<ParamsToFcm> { if &self.notification_key == "" { Some(ParamsToFcm { url: webpush.reg.clone(), order_id: -1, webpush: webpush, params: Params { operation: "create".to_string(), notification_key_name: self.shop_id.clone(), notification_key: self.notification_key.clone(), registration_ids: vec![self.params.sw_token.clone()], }, }) } else { if &self.device_cnt > &0 { None } else { Some(ParamsToFcm { url: webpush.reg.clone(), order_id: -1, webpush: webpush, params: Params { operation: "add".to_string(), notification_key_name: self.shop_id.clone(), notification_key: self.notification_key.clone(), registration_ids: vec![self.params.sw_token.clone()], }, }) } } } } */ #[derive(Deserialize, Serialize, Debug, Message, AsChangeset)] #[rtype(result = "Result<Msg, ServiceError>")] #[table_name = "user_device"] pub struct Update { pub id: i32, pub name: String, pub sw_token: String, }
use super::*; /// Represents the built-in FuncOp from the `func` dialect #[repr(transparent)] #[derive(Copy, Clone)] pub struct FuncOp(OperationBase); impl FuncOp { /// Returns the function symbol name pub fn name(self) -> StringRef { SymbolTable::get_symbol_name(self) } /// Returns the visibility of this function pub fn visibility(self) -> Visibility { SymbolTable::get_symbol_visibility(self) } /// Sets the visibility of this function pub fn set_visibility(self, visibility: Visibility) { SymbolTable::set_symbol_visibility(self, visibility) } /// Returns the type signature of this function pub fn get_type(&self) -> FunctionType { unsafe { mlir_func_op_get_type(*self) } } } impl TryFrom<OperationBase> for FuncOp { type Error = InvalidTypeCastError; fn try_from(op: OperationBase) -> Result<Self, Self::Error> { if unsafe { mlir_operation_isa_func_op(op) } { Ok(Self(op)) } else { Err(InvalidTypeCastError) } } } impl Operation for FuncOp { fn base(&self) -> OperationBase { self.0 } } extern "C" { #[link_name = "mlirOperationIsAFuncOp"] fn mlir_operation_isa_func_op(op: OperationBase) -> bool; #[link_name = "mlirFuncOpGetType"] fn mlir_func_op_get_type(op: FuncOp) -> FunctionType; #[link_name = "mlirFuncBuildFuncOp"] pub(super) fn mlir_func_build_func_op( builder: OpBuilderBase, loc: Location, name: StringRef, ty: types::FunctionType, num_attrs: usize, attrs: *const NamedAttribute, num_arg_attrs: usize, arg_attrs: *const DictionaryAttr, ) -> FuncOp; }
use super::super::stat::Stat; #[allow(dead_code)] pub enum LevelColumn { MP, MAIN, SUB, DIV, HP, ELMT, THREAT, } // Assume level 80 // https://www.akhmorning.com/allagan-studies/modifiers/ #[allow(dead_code)] pub fn level_modifiers(column: LevelColumn) -> i64 { match column { LevelColumn::MP => 10000, LevelColumn::MAIN => 340, LevelColumn::SUB => 380, LevelColumn::DIV => 3300, LevelColumn::HP => 4400, LevelColumn::ELMT => 0, // ??? on akhmorning. https://www.akhmorning.com/allagan-studies/modifiers/levelmods/ LevelColumn::THREAT => 569, } } #[allow(dead_code)] #[derive(Debug, Copy, Clone)] pub enum Job { GLA, PGL, MRD, LNC, ARC, CNJ, THM, PLD, MNK, WAR, DRG, BRD, WHM, BLM, ACN, SMN, SCH, ROG, NIN, MCH, DRK, AST, SAM, RDM, BLU, GNB, DNC, None, } impl Job { pub fn primary_stat(&self) -> Stat { match self { Job::LNC | Job::PGL | Job::DRG | Job::MNK | Job::SAM => Stat::Strength, Job::ARC | Job::ROG | Job::BRD | Job::NIN | Job::MCH | Job::DNC => Stat::Dexterity, Job::GLA | Job::MRD | Job::PLD | Job::WAR | Job::DRK | Job::GNB => Stat::Strength, Job::THM | Job::ACN | Job::BLM | Job::SMN | Job::RDM | Job::BLU => Stat::Intelligence, Job::CNJ | Job::WHM | Job::SCH | Job::AST => Stat::Mind, _ => panic!("Tried to get primary stat of unknown job: {:?}", self), } } pub fn trait_multiplier(&self) -> i64 { match self { Job::ARC | Job::BRD | Job::MCH | Job::DNC => 120, Job::THM | Job::ACN | Job::BLM | Job::SMN | Job::RDM => 130, Job::CNJ | Job::WHM | Job::SCH | Job::AST => 130, Job::BLU => 150, _ => 100, } } pub fn is_tank(self) -> bool { match self { Job::GLA | Job::MRD | Job::PLD | Job::WAR | Job::DRK | Job::GNB => true, _ => false, } } } macro_rules! job_stat_match { ($stat:expr, $hp:expr, $mp:expr, $strength:expr, $vitality:expr, $dexterity:expr, $intelligence:expr, $mind:expr) => { match $stat { Stat::Strength => $strength, Stat::Vitality => $vitality, Stat::Dexterity => $dexterity, Stat::Intelligence => $intelligence, Stat::Mind => $mind, _ => 0, } }; } // TODO: Maybe this should be a CSV or something, but this works for now. // https://www.akhmorning.com/allagan-studies/modifiers/ pub fn job_modifiers(job: Job, stat: Stat) -> i64 { match job { Job::GLA => job_stat_match!(stat, 110, 49, 95, 100, 90, 50, 95), Job::PGL => job_stat_match!(stat, 105, 34, 100, 95, 100, 45, 85), Job::MRD => job_stat_match!(stat, 115, 28, 100, 100, 90, 30, 50), Job::LNC => job_stat_match!(stat, 110, 39, 105, 100, 95, 40, 60), Job::ARC => job_stat_match!(stat, 100, 69, 85, 95, 105, 80, 75), Job::CNJ => job_stat_match!(stat, 100, 117, 50, 95, 100, 100, 105), Job::THM => job_stat_match!(stat, 100, 123, 40, 95, 95, 105, 70), Job::PLD => job_stat_match!(stat, 120, 59, 100, 110, 95, 60, 100), Job::MNK => job_stat_match!(stat, 110, 43, 110, 100, 105, 50, 90), Job::WAR => job_stat_match!(stat, 125, 38, 105, 110, 95, 40, 55), Job::DRG => job_stat_match!(stat, 115, 49, 115, 105, 100, 45, 65), Job::BRD => job_stat_match!(stat, 105, 79, 90, 100, 115, 85, 80), Job::WHM => job_stat_match!(stat, 105, 124, 55, 100, 105, 105, 115), Job::BLM => job_stat_match!(stat, 105, 129, 45, 100, 100, 115, 75), Job::ACN => job_stat_match!(stat, 100, 110, 85, 95, 95, 105, 75), Job::SMN => job_stat_match!(stat, 105, 111, 90, 100, 100, 115, 80), Job::SCH => job_stat_match!(stat, 105, 119, 90, 100, 100, 105, 115), Job::ROG => job_stat_match!(stat, 103, 38, 80, 95, 100, 60, 70), Job::NIN => job_stat_match!(stat, 108, 48, 85, 100, 110, 65, 75), Job::MCH => job_stat_match!(stat, 105, 79, 85, 100, 115, 80, 85), Job::DRK => job_stat_match!(stat, 120, 79, 105, 110, 95, 60, 40), Job::AST => job_stat_match!(stat, 105, 124, 50, 100, 100, 105, 115), Job::SAM => job_stat_match!(stat, 109, 40, 112, 100, 108, 60, 50), Job::RDM => job_stat_match!(stat, 105, 120, 55, 100, 105, 115, 110), Job::BLU => job_stat_match!(stat, 105, 120, 70, 100, 110, 115, 105), Job::GNB => job_stat_match!(stat, 120, 59, 100, 110, 95, 60, 100), Job::DNC => job_stat_match!(stat, 105, 79, 90, 100, 115, 85, 80), _ => panic!("Tried to get base stats of unknown job: {:?}", job), } }
use std::error::Error; use std::result::Result; use structopt::StructOpt; /// Parse a single key-value pair fn parse_key_val<T, U>(s: &str) -> Result<(T, U), Box<dyn Error>> where T: std::str::FromStr, T::Err: Error + 'static, U: std::str::FromStr, U::Err: Error + 'static, { let pos = s .find('=') .ok_or_else(|| format!("invalid KEY=value: no `=` found in `{}`", s))?; Ok((s[..pos].parse()?, s[pos + 1..].parse()?)) } #[derive(StructOpt, Debug)] pub enum Command { /// The generic version of the other commands IssueCommand { #[structopt(short, long = "prop", parse(try_from_str = parse_key_val), name = "key=value")] properties: Vec<(String, String)>, command: String, message: Option<String>, }, /// Set and environment variable for future actions in the job /// /// Creates or updates an environment variable for any actions running next in a job. /// The action that creates or updates the environment variable does not have access to the /// new value, but all subsequent actions in a job will have access. Environment variables are /// case-sensitive and you can include punctuation. SetEnv { /// The name of the variable to set key: String, /// The value of the variable to set value: String, }, /// Like set-env but exports an existing environment variable Export { /// The environment variable key key: String, }, /// Set an output parameter. /// /// Sets an action's output parameter. /// Optionally, you can also declare output parameters in an action's metadata file. SetOutput { /// Name of the output to set name: String, /// Value to store value: String, }, /// Add a system path /// /// Prepends a directory to the system `PATH` variable for all subsequent actions in the /// current job. The currently running action cannot access the new path variable. AddPath { /// An absolute or relative path. Relative paths automatically get expanded to their /// absolute value. path: String, }, /// Gets whether Actions Step Debug is on or not. /// /// If the exit status of that command is zero then the action step debug is on. IsDebug, /// Set a debug message /// /// Creates a debug message and prints the message to the log. You can optionally provide a /// filename (file), line number (line), and column (col) number where the warning occurred. /// /// You must create a secret named `ACTIONS_STEP_DEBUG` with the value `true` to see the debug /// messages set by this command in the log. Debug { #[structopt(short, long)] file: Option<String>, #[structopt(short, long)] line: Option<u64>, #[structopt(short, long, alias = "column", name = "column")] col: Option<u64>, /// Debug message message: String, }, /// Set a warning message /// /// Creates a warning message and prints the message to the log. You can optionally provide a /// filename (file), line number (line), and column (col) number where the warning occurred. Warning { #[structopt(short, long)] file: Option<String>, #[structopt(short, long)] line: Option<u64>, #[structopt(short, long, alias = "column", name = "column")] col: Option<u64>, /// Warning message message: String, }, /// Set an error message /// /// Creates an error message and prints the message to the log. You can optionally provide a /// filename (file), line number (line), and column (col) number where the warning occurred. Error { #[structopt(short, long)] file: Option<String>, #[structopt(short, long)] line: Option<u64>, #[structopt(short, long, alias = "column", name = "column")] col: Option<u64>, /// Error message message: String, }, /// Mask a value in log /// /// Masking a value prevents a string or variable from being printed in the log. Each masked /// word separated by whitespace is replaced with the `*` character. You can use an /// environment variable or string for the mask's value. AddMask { /// Value of the secret value: String, }, /// Stop and start log commands /// /// Stops processing any logging commands. This special command allows you to log anything /// without accidentally running a log command. For example, you could stop logging to /// output an entire script that has comments. /// /// To start log commands, pass the token that you used to stop logging. Eg: /// /// action-cli issue-command "endtoken" /// StopCommands { endtoken: String }, /// Gets the value of an input. The value is also trimmed. GetInput { name: String, #[structopt(short, long)] required: bool, }, /// Begin an output group. /// /// Output until the next `groupEnd` will be foldable in this group StartGroup { /// The name of the output group name: String, }, /// End an output group. EndGroup, /// Saves state for current action, the state can only be retrieved by this action's post job execution. SaveState { /// Name of the state to store name: String, /// Value to store value: String, }, /// Gets the value of an state set by this action's main execution. GetState { /// Name of the state to get name: String, }, } #[derive(StructOpt, Debug)] struct Opt { #[structopt(subcommand)] command: Command, } fn escape_data<T: AsRef<str>>(s: T) -> String { s.as_ref() .replace("%", "%25") .replace("\r", "%0D") .replace("\n", "%0A") } fn escape_property<T: AsRef<str>>(s: T) -> String { escape_data(s).replace(":", "%3A").replace(",", "%2C") } // https://github.com/actions/toolkit/blob/3261dd988308cb227481dc6580026034e5780160/packages/core/src/command.ts fn issue_command<T, U>(command: T, message: U, properties: Vec<(String, String)>) -> String where T: AsRef<str>, U: AsRef<str>, { let mut cmd_str = format!("::{}", command.as_ref()); if !properties.is_empty() { let joined_props = properties .iter() .map(|(key, value)| format!("{}={}", key, escape_property(value))) .collect::<Vec<String>>() .join(","); cmd_str = format!("{} {}", cmd_str, joined_props); } cmd_str = format!("{}::{}", cmd_str, escape_data(message.as_ref())); cmd_str } fn log_command<T, U>( command: T, message: U, file: Option<String>, line: Option<u64>, col: Option<u64>, ) -> String where T: AsRef<str>, U: AsRef<str>, { let mut params = Vec::new(); if let Some(file) = file { params.push(("file".to_owned(), file)) } if let Some(line) = line { params.push(("line".to_owned(), format!("{}", line))) } if let Some(col) = col { params.push(("col".to_owned(), format!("{}", col))) } issue_command(command, message, params) } fn issue<T, U>(command: T, message: U) -> String where T: AsRef<str>, U: AsRef<str>, { issue_command(command, message, vec![]) } fn main() -> Result<(), Box<dyn std::error::Error>> { let opt = Opt::from_args(); let out = match opt.command { Command::IssueCommand { command, message, properties, } => match message { Some(message) => issue_command(&command[..], message, properties), None => issue_command(&command[..], "", properties), }, Command::SetEnv { key, value } => { issue_command("set-env", value, vec![("name".to_owned(), key)]) } Command::Export { key } => { let val = std::env::var(key.clone())?; issue_command("set-env", val, vec![("name".to_owned(), key)]) } Command::SetOutput { name, value } => { issue_command("set-output", value, vec![("name".to_owned(), name)]) } Command::AddPath { path } => { let path = std::fs::canonicalize(path)?; issue("add-path", path.to_string_lossy().into_owned()) } Command::AddMask { value } => issue("add-mask", value), Command::GetInput { name, required } => { let key = format!("INPUT_{}", name.replace(" ", "_").to_ascii_uppercase()); match std::env::var(key) { Ok(val) => val.trim().to_owned(), Err(e) => { if required { panic!(e) } else { "".to_owned() } } } } Command::IsDebug => std::env::var("RUNNER_DEBUG")?, Command::Debug { message, file, line, col, } => log_command("debug", message, file, line, col), Command::Warning { message, file, line, col, } => log_command("warning", message, file, line, col), Command::Error { message, file, line, col, } => log_command("error", message, file, line, col), Command::StopCommands { endtoken } => issue("stop-commands", endtoken), Command::StartGroup { name } => issue("group", name), Command::EndGroup => issue("endgroup", "".to_owned()), Command::SaveState { name, value } => { issue_command("save-state", value, vec![("name".to_owned(), name)]) } Command::GetState { name } => { let key = format!("STATE_{}", name); match std::env::var(key) { Ok(val) => val, Err(_) => "".to_owned(), } } }; println!("{}", out); Ok(()) }
use liblumen_alloc::erts::exception::InternalResult; use liblumen_alloc::erts::term::prelude::*; use liblumen_alloc::erts::Process; use super::{try_split_at, u32, u8}; pub fn decode<'a>(process: &Process, bytes: &'a [u8]) -> InternalResult<(Term, &'a [u8])> { let (len_u32, after_len_bytes) = u32::decode(bytes)?; let len_usize = len_u32 as usize; let (partial_byte_bit_len, after_partial_byte_bit_len_bytes) = u8::decode(after_len_bytes)?; assert!(0 < partial_byte_bit_len); try_split_at(after_partial_byte_bit_len_bytes, len_usize).map( |(data_bytes, after_data_bytes)| { let original = process.binary_from_bytes(data_bytes); let subbinary = process.subbinary_from_original( original, 0, 0, len_usize - 1, partial_byte_bit_len, ); (subbinary, after_data_bytes) }, ) }
use chrono::offset::Utc; use chrono::DateTime; use libc::{time, sleep, difftime, gmtime, mktime, localtime}; use std::ptr; use std::time::{Duration, UNIX_EPOCH}; use std::ops::Add; use std::ffi::CStr; fn main() { unsafe { let time1 = time(ptr::null_mut()); sleep(2); let time2 = time(ptr::null_mut()); println!("time2 = {}", time2); let difftime = difftime(time1, time2); println!("difftime = {}", difftime); let tm = gmtime(&time2 as *const i64); println!("{} {} {}", (*tm).tm_hour, (*tm).tm_min, (*tm).tm_sec); // 不等于之前的time2?? let time2 = mktime(tm); println!("time2 = {}", time2); let tm = localtime( &time2 as *const i64); println!("{} {} {}", (*tm).tm_hour, (*tm).tm_min, (*tm).tm_sec); // let mut fmt_time = [0i8;100] ; // strftime((&mut fmt_time).as_mut_ptr(), 100, b"%d/%m/%Y %T\x00".as_ptr() as *const i8, tm); // println!("strftime = {}", CStr::from_ptr((&fmt_time).as_ptr()).to_str().unwrap()); //rust let du = Duration::new(time2 as u64, 0); let now:DateTime<Utc> = UNIX_EPOCH.add(du).into(); println!("{}", now.format("%d/%m/%Y %T")); } }
pub use self::dmi::*; pub use self::io::*; pub use self::mmio::*; pub use self::pio::*; mod dmi; mod io; mod mmio; mod pio;
fn is_palindrome(s: &str) -> bool { let len = s.len() - 1; let offset = if len % 2 == 0 { 0 } else { 1 }; let start = s[..(len + offset) / 2].chars(); let end = s[(len - offset) / 2 + 1..].chars().rev(); start.zip(end).fold(true, |state, (x, y)| state && x == y) } fn main() { let mut m: Vec<u32> = (100..=999).collect(); let mut found = false; m.reverse(); for i in 0..m.len() { if found { break; } for j in 0..=i { let x = m[i]; let y = m[j]; dbg!(x*y); if is_palindrome(&format!("{}", x * y)) { println!("{} * {} = {}", x, y, x * y); found = true; break; } } } }
//! A generic UI state model for scrollable view of hexagonal grids. use crate::geo::{ Bounds, Hexagon }; use crate::grid::{ Grid, Coords }; use crate::ui::scroll; use nalgebra::Point2; /// The state of a scrollable grid view. pub struct State<C: Coords> { grid: Grid<C>, viewport: Bounds, position: Point2<f32>, } impl<C: Coords> State<C> { /// Create a new scrollable view state for the given grid /// and with the given bounds. pub fn new(grid: Grid<C>, bounds: Bounds) -> State<C> { State { grid, position: bounds.position, viewport: Bounds { position: Point2::origin(), width: bounds.width, height: bounds.height }, } } pub fn position(&self) -> Point2<f32> { self.position } pub fn grid(&self) -> &Grid<C> { &self.grid } pub fn width(&self) -> f32 { self.viewport.width } pub fn height(&self) -> f32 { self.viewport.height } /// Get a reference to the bounds of the viewport. The position /// is relative to the position of the grid, i.e. scrolling moves /// the viewport over the grid. The width and height of the viewport /// correspond to the width and height of the grid view. pub fn viewport(&self) -> &Bounds { &self.viewport } /// Get a hexagon on the grid by its pixel coordinates. pub fn from_pixel(&self, p: Point2<f32>) -> Option<(C, &Hexagon)> { // FIXME: Turn self.position into bounds. self.viewport and // self.bounds differ only in position - width and height must // be kept in-sync. let bounds = Bounds { position: self.position, width: self.width(), height: self.height() }; if !bounds.contains(p) { return None } self.grid.from_pixel(p - self.position.coords + self.viewport.position.coords) } /// Get an iterator over the hexagons currently in the viewport. pub fn iter_viewport(&self) -> impl Iterator<Item=(&C, &Hexagon)> + '_ { self.grid.iter_within(&self.viewport) } /// Scroll the viewport over the grid. pub fn scroll(&mut self, scroll: scroll::Delta) { let grid = self.grid.dimensions(); let old_p = self.viewport.position; let new_x = old_p.x + scroll.dx; let new_y = old_p.y + scroll.dy; let max_x = grid.width - self.viewport.width; let max_y = grid.height - self.viewport.height; self.viewport.position.x = f32::min(max_x, f32::max(0., new_x)); self.viewport.position.y = f32::min(max_y, f32::max(0., new_y)); } /// Schedule a resize of the view for the next update. pub fn resize(&mut self, width: u32, height: u32) { self.viewport.width = width as f32; self.viewport.height = height as f32; // Adjust the viewport position according to the new size, // so it doesn't "jump" on the next scroll. self.scroll(scroll::Delta { dx: 0.0, dy: 0.0 }); } /// The current position of the grid (i.e. the top-left corner of the /// grid's bounding box) on the screen coordinate system. /// /// Rendering the grid at this position "pulls" the viewport, which /// moves across the grid, into the grid view. pub fn grid_position(&self) -> Point2<f32> { -self.viewport.position + self.position.coords } }
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use anyhow::Result; use lazy_static::lazy_static; use log::LevelFilter; use log4rs::append::console::{ConsoleAppender, Target}; use log4rs::append::file::FileAppender; use log4rs::config::{Appender, Config, Root}; use log4rs::encode::pattern::PatternEncoder; use log4rs::Handle; use std::path::PathBuf; use std::sync::Mutex; use std::sync::{Arc, Once}; /// Logger prelude which includes all logging macros. pub mod prelude { pub use log::{debug, error, info, log_enabled, trace, warn, Level, LevelFilter}; } #[derive(Debug, Clone, PartialOrd, PartialEq, Ord, Eq)] struct LoggerConfigArg { enable_stderr: bool, level: LevelFilter, log_path: Option<PathBuf>, } impl LoggerConfigArg { pub fn new(enable_stderr: bool, level: LevelFilter, log_path: Option<PathBuf>) -> Self { Self { enable_stderr, level, log_path, } } } pub struct LoggerHandle { arg: Mutex<LoggerConfigArg>, handle: Handle, } impl LoggerHandle { fn new( enable_stderr: bool, level: LevelFilter, log_path: Option<PathBuf>, handle: Handle, ) -> Self { Self { arg: Mutex::new(LoggerConfigArg { enable_stderr, level, log_path, }), handle, } } pub fn enable_stderr(&self) { let mut arg = self.arg.lock().unwrap().clone(); arg.enable_stderr = true; self.update_logger(arg); } pub fn disable_stderr(&self) { let mut arg = self.arg.lock().unwrap().clone(); arg.enable_stderr = false; self.update_logger(arg); } pub fn enable_file(&self, enable_stderr: bool, log_path: PathBuf) { let mut arg = self.arg.lock().unwrap().clone(); arg.enable_stderr = enable_stderr; arg.log_path = Some(log_path); self.update_logger(arg); } pub fn update_level(&self, level: LevelFilter) { let mut arg = self.arg.lock().unwrap().clone(); arg.level = level; self.update_logger(arg); } fn update_logger(&self, arg: LoggerConfigArg) { let mut origin_arg = self.arg.lock().unwrap(); if *origin_arg != arg { let config = build_config(arg.clone()).expect("rebuild log config should success."); *origin_arg = arg; self.handle.set_config(config); } } /// Get log path pub fn log_path(&self) -> Option<PathBuf> { self.arg.lock().unwrap().log_path.as_ref().cloned() } /// Check is stderr enabled pub fn stderr(&self) -> bool { self.arg.lock().unwrap().enable_stderr } pub fn level(&self) -> LevelFilter { self.arg.lock().unwrap().level } } const LOG_PATTERN: &str = "{d} {l} {M}::{f}::{L} - {m}{n}"; fn build_config(arg: LoggerConfigArg) -> Result<Config> { let LoggerConfigArg { enable_stderr, level, log_path, } = arg; if !enable_stderr && log_path.is_none() { println!("Logger is disabled."); } let mut builder = Config::builder(); let mut root_builder = Root::builder(); if enable_stderr { let stderr = ConsoleAppender::builder() .encoder(Box::new(PatternEncoder::new(LOG_PATTERN))) .target(Target::Stderr) .build(); builder = builder.appender(Appender::builder().build("stderr", Box::new(stderr))); root_builder = root_builder.appender("stderr"); } if let Some(log_path) = log_path { let file_appender = FileAppender::builder() .encoder(Box::new(PatternEncoder::new(LOG_PATTERN))) .build(log_path) .unwrap(); builder = builder.appender(Appender::builder().build("file", Box::new(file_appender))); root_builder = root_builder.appender("file"); } builder .build(root_builder.build(level)) .map_err(|e| e.into()) } fn env_log_level(default_level: &str) -> LevelFilter { let level = std::env::var("RUST_LOG").unwrap_or(default_level.to_string()); level .parse() .expect(format!("Unexpect log level: {}", level).as_str()) } lazy_static! { static ref LOGGER_HANDLE: Mutex<Option<Arc<LoggerHandle>>> = Mutex::new(None); } pub fn init() -> Arc<LoggerHandle> { init_with_default_level("info") } pub fn init_with_default_level(default_level: &str) -> Arc<LoggerHandle> { let level = env_log_level(default_level); LOG_INIT.call_once(|| { let config = build_config(LoggerConfigArg::new(true, level, None)).expect("build log config fail."); let handle = match log4rs::init_config(config) { Ok(handle) => handle, Err(e) => panic!(format!("{}", e.to_string())), }; let logger_handle = LoggerHandle::new(true, level, None, handle); *LOGGER_HANDLE.lock().unwrap() = Some(Arc::new(logger_handle)); }); let logger_handle = LOGGER_HANDLE .lock() .unwrap() .as_ref() .expect("logger handle must has been set.") .clone(); if logger_handle.level() != level { logger_handle.update_level(level); } logger_handle } static LOG_INIT: Once = Once::new(); pub fn init_for_test() -> Arc<LoggerHandle> { init_with_default_level("debug") } #[cfg(test)] mod tests { use super::prelude::*; #[test] fn test_log() { let handle = super::init_for_test(); debug!("debug message2."); info!("info message."); warn!("warn message."); error!("error message."); let handle2 = super::init_for_test(); assert_eq!(handle.level(), handle2.level()); assert_eq!(handle.log_path(), handle2.log_path()); assert_eq!(handle.stderr(), handle2.stderr()); let origin_level = handle.level(); handle.update_level(LevelFilter::Off); assert_eq!(handle.level(), LevelFilter::Off); assert_eq!(handle.level(), handle2.level()); handle.update_level(origin_level); } }
use crate::{types::PyComparisonOp, vm::VirtualMachine, PyObjectRef, PyResult}; use itertools::Itertools; pub trait PyExactSizeIterator<'a>: ExactSizeIterator<Item = &'a PyObjectRef> + Sized { fn eq(self, other: impl PyExactSizeIterator<'a>, vm: &VirtualMachine) -> PyResult<bool> { let lhs = self; let rhs = other; if lhs.len() != rhs.len() { return Ok(false); } for (a, b) in lhs.zip_eq(rhs) { if !vm.identical_or_equal(a, b)? { return Ok(false); } } Ok(true) } fn richcompare( self, other: impl PyExactSizeIterator<'a>, op: PyComparisonOp, vm: &VirtualMachine, ) -> PyResult<bool> { let less = match op { PyComparisonOp::Eq => return PyExactSizeIterator::eq(self, other, vm), PyComparisonOp::Ne => return PyExactSizeIterator::eq(self, other, vm).map(|eq| !eq), PyComparisonOp::Lt | PyComparisonOp::Le => true, PyComparisonOp::Gt | PyComparisonOp::Ge => false, }; let lhs = self; let rhs = other; let lhs_len = lhs.len(); let rhs_len = rhs.len(); for (a, b) in lhs.zip(rhs) { if vm.bool_eq(a, b)? { continue; } let ret = if less { vm.bool_seq_lt(a, b)? } else { vm.bool_seq_gt(a, b)? }; if let Some(v) = ret { return Ok(v); } } Ok(op.eval_ord(lhs_len.cmp(&rhs_len))) } } impl<'a, T> PyExactSizeIterator<'a> for T where T: ExactSizeIterator<Item = &'a PyObjectRef> + Sized {}
use std::fs; use std::collections::HashSet; fn main() { let input_numbers = parse_input(); let mut numbers: HashSet<usize> = HashSet::new(); for i in input_numbers { if numbers.contains(&(2020 - i)) { println!("Found: {}", i * (2020 - i)); } numbers.insert(i); } } fn parse_input() -> HashSet<usize> { let content = fs::read_to_string("inputs/day1.txt").unwrap(); content.split("\n").map(|line| line.parse().unwrap()).collect() }
use ggez::graphics::*; use specs::{Builder, World}; use std::collections::HashMap; use components::*; use state::*; pub struct CharacterBuilder { id: Option<EntityID>, tile_width: Option<usize>, pub render: Option<EntityRender>, t_pos: Option<TilePosition>, anim_map: HashMap<String, Vec<usize>>, start_state: Option<Box<State<Character> + Sync>>, } impl CharacterBuilder { const DEFAULT_TILE_WIDTH: usize = 16; pub fn new() -> Self { CharacterBuilder { id: None, tile_width: None, render: None, t_pos: None, anim_map: HashMap::new(), start_state: None, } } pub fn id(&mut self, id: &str) { self.id = Some(EntityID(id.to_owned())); } pub fn tile_width(&mut self, tw: usize) { self.tile_width = Some(tw); } pub fn render(&mut self, render: EntityRender) { self.render = Some(render); } pub fn t_pos(&mut self, t_pos: TilePosition) { self.t_pos = Some(t_pos); } pub fn anim(&mut self, name: &str, frames: Vec<usize>) { self.anim_map.insert(name.to_owned(), frames); } pub fn start_state(&mut self, state: Box<State<Character> + Sync>) { self.start_state = Some(state); } pub fn add(self, world: &mut World) { let tile_width = match self.tile_width { Some(tw) => tw, None => CharacterBuilder::DEFAULT_TILE_WIDTH, }; let id = match self.id { Some(id) => id, None => panic!("No id found"), }; let t_pos = match self.t_pos { Some(t_pos) => t_pos, None => panic!("No tile position"), }; let render = match self.render { Some(render) => render, None => panic!("No renderer found"), }; let state = match self.start_state { Some(state) => state, None => panic!("No start state found"), }; let anim = Animation::new(self.anim_map, "idle", true, None); let pos = Position(Point2::new( (tile_width * t_pos.x) as f32 + (tile_width as f32 / 2.0) - (render.width as f32 / 2.0), (tile_width * (t_pos.y + 1)) as f32 - (render.height as f32), )); world .create_entity() .with(id) .with(pos) .with(t_pos) .with(render) .with(anim) .with(CharacterController::new(state)) .build(); } }
//! Contains helper functions use crate::characteranimation::CharacterAnimation; use crate::charactermeta::CharacterDirection; use crate::charactermeta::CharacterMeta; use crate::charactermove::CharacterMove; use crate::spriteanimation::SpriteAnimation; use crate::spriteanimationloader::SpriteAnimationStore; use crate::forces::RadialForceField; use amethyst::{ prelude::*, core::transform::Transform, ecs::world::EntityBuilder, renderer::{SpriteRender}, }; use specs_physics::{PhysicsBodyBuilder, PhysicsBody, nphysics::object::BodyStatus, nalgebra::{Vector3}, PhysicsColliderBuilder, PhysicsCollider, colliders::Shape, }; /// Assembles a character on the map /// /// Assigns the components to the EntityBuilder which are required /// to have a moving character on the screen. /// /// For the animations, it requires to have animation names following /// this pattern: /// * (name)_walk_up /// * (name)_walk_down /// * (name)_walk_left /// * (name)_walk_right /// /// ## Examples /// ``` /// use helper::create_character; /// /// create_character( /// world.create_entity(), /// &animations, /// (300.0, 300.0), /// (-16.0, 16.0, -16.0, 16.0), /// "hero" /// ).build(); /// ``` pub fn create_character<'a>( entity_builder: EntityBuilder<'a>, animations: &SpriteAnimationStore, (x, y): (f32, f32), char_name: &str, ) -> EntityBuilder<'a> { println!("Create character start"); let animation_up = format!("{}_walk_up", char_name); let animation_down = format!("{}_walk_down", char_name); let animation_left = format!("{}_walk_left", char_name); let animation_right = format!("{}_walk_right", char_name); let mut sprite_animation = SpriteAnimation::new( animations .animations .get(&animation_up) .map(|x| x.clone()) .unwrap_or(vec![0]), 0.1, ); sprite_animation.pause = true; let character_meta = CharacterMeta::new(CharacterDirection::Down); let character_animation = CharacterAnimation { prev_character_meta: character_meta.clone(), walk_up_animation: animations .animations .get(&animation_up) .map(|x| x.clone()) .unwrap_or(vec![0]), walk_down_animation: animations .animations .get(&animation_down) .map(|x| x.clone()) .unwrap_or(vec![0]), walk_left_animation: animations .animations .get(&animation_left) .map(|x| x.clone()) .unwrap_or(vec![0]), walk_right_animation: animations .animations .get(&animation_right) .map(|x| x.clone()) .unwrap_or(vec![0]), }; let sprite_render = SpriteRender { sprite_sheet: animations.sprite_sheet_handle.clone(), sprite_number: 0, }; let mut transform = Transform::default(); transform.set_translation_xyz(x, y, -y); let physics_body: PhysicsBody<f32> = PhysicsBodyBuilder::from(BodyStatus::Dynamic) .lock_rotations(true) .build(); let physics_collider: PhysicsCollider<f32> = PhysicsColliderBuilder::from(Shape::Cuboid { half_extents: Vector3::new(13.0, 13.0, 300.0) }) .angular_prediction(0.0) .build(); println!("Create character end"); entity_builder .with(sprite_render) .with(transform) .with(sprite_animation) //.with(Transparent) .with(CharacterMove::new(128.0)) .with(character_meta) .with(character_animation) // .with(Physics::new()) // .with(BoundingRect::new(left, right, bottom, top)) .with(physics_body) .with(physics_collider) .with(RadialForceField::new(20000000.0)) } /// Assebles a solid entity /// /// Assigns the components to the EntityBuilder which are required /// to have a solid enity. /// /// The name must match the sprite name in. /// /// ## Examples /// ``` /// use helper::create_solid; /// /// create_solid( /// world.create_entity(), /// &animations, /// (300.0, 300.0), /// (-16.0, 16.0, -16.0, 16.0), /// "hero" /// ).build(); /// ``` pub fn create_solid<'a>( entity_builder: EntityBuilder<'a>, animations: &SpriteAnimationStore, (x, y): (f32, f32), name: &str, ) -> EntityBuilder<'a> { let sprite_render = animations.get_sprite_render(name).unwrap(); let mut transform = Transform::default(); transform.set_translation_xyz(x, y, -y); let physics_body: PhysicsBody<f32> = PhysicsBodyBuilder::from(BodyStatus::Static) .build(); let physics_collider: PhysicsCollider<f32> = PhysicsColliderBuilder::from(Shape::Cuboid { half_extents: Vector3::new(16.0, 16.0, 300.0) }) .build(); entity_builder .with(sprite_render) .with(transform) .with(physics_body) .with(physics_collider) // .with(BoundingRect::new(left, right, bottom, top)) // .with(Transparent) // .with(Solid) } pub fn create_walkable_solid<'a>( entity_builder: EntityBuilder<'a>, (x, y): (f32, f32), ) -> EntityBuilder<'a> { let mut transform = Transform::default(); transform.set_translation_xyz(x, y, -y); let physics_body: PhysicsBody<f32> = PhysicsBodyBuilder::from(BodyStatus::Static) .build(); let physics_collider: PhysicsCollider<f32> = PhysicsColliderBuilder::from(Shape::Cuboid { half_extents: Vector3::new(16.0, 16.0, 300.0) }) .sensor(true) .build(); entity_builder .with(transform) .with(physics_body) .with(physics_collider) // .with(BoundingRect::new(left, right, bottom, top)) // .with(Transparent) // .with(Solid) } /// Assembles a walkable entity /// /// Assigns the components to the EntityBuilder which are required /// to have a solid entity. /// /// The name must match the sprite name in. /// /// ## Examples /// ``` /// use helper::create_solid; /// /// create_solid( /// world.create_entity(), /// &animations, /// (300.0, 300.0), /// (-16.0, 16.0, -16.0, 16.0), /// "hero" /// ).build(); /// ``` pub fn create_walkable<'a>( entity_builder: EntityBuilder<'a>, animations: &SpriteAnimationStore, (x, y): (f32, f32), name: &str, ) -> EntityBuilder<'a> { let sprite_render = SpriteRender { sprite_sheet: animations.sprite_sheet_handle.clone(), sprite_number: *animations.images.get(name).unwrap_or(&0), }; let mut transform = Transform::default(); transform.set_translation_xyz(x, y, -y); entity_builder .with(sprite_render) .with(transform) // .with(BoundingRect::new(left, right, bottom, top)) // .with(Transparent) }
//! Provides a generic framework for building copy-on-write B-Tree-like structures. //! //! The design and implementation was inspired by [xi-rope]. //! //! [xi-rope]: https://github.com/google/xi-editor/tree/master/rust/rope extern crate arrayvec; extern crate mines; #[macro_use] mod macros; pub mod cursor; pub mod node; pub mod traits; #[cfg(test)] extern crate rand; #[cfg(test)] mod test_help;
fn main() { // data type // integer: i8, u8, i16, u16, i32, u32, i64, u64 -> actual memory let a = 1 + 20; let s = 32 - 20; let m = 5 * 10; // float: f32, f64 // bool: true/false let b = true; // tuple let t: (i32, f64, char) = (42, 6.12, 'j'); let (_, _, x) = t; // array let arr = [1,2,3,5,6,7,8]; let arr1 = arr[0]; }
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! Names of modules and functions used by Libra System. use libra_types::language_storage::ModuleId as LibraModuleId; use move_core_types::identifier::Identifier; use once_cell::sync::Lazy; use types::{account_config, language_storage::ModuleId}; // Data to resolve basic account and transaction flow functions and structs /// LBR static LBR_MODULE_NAME: Lazy<Identifier> = Lazy::new(|| Identifier::new("LBR").unwrap()); pub static LBR_MODULE: Lazy<LibraModuleId> = Lazy::new(|| { ModuleId::new(account_config::core_code_address(), LBR_MODULE_NAME.clone()).into() }); /// Starcoin static STARCOIN_MODULE_NAME: Lazy<Identifier> = Lazy::new(|| Identifier::new("Starcoin").unwrap()); pub static STARCOIN_MODULE: Lazy<LibraModuleId> = Lazy::new(|| { ModuleId::new( account_config::core_code_address(), STARCOIN_MODULE_NAME.clone(), ) .into() }); /// The ModuleId for the Account module pub static ACCOUNT_MODULE: Lazy<LibraModuleId> = Lazy::new(|| { let module_id = ModuleId::new( account_config::core_code_address(), Identifier::new("LibraAccount").unwrap(), ); module_id.into() }); /// The ModuleId for the LibraTransactionTimeout module pub static LIBRA_TRANSACTION_TIMEOUT: Lazy<LibraModuleId> = Lazy::new(|| { let module_id = ModuleId::new( account_config::core_code_address(), Identifier::new("LibraTransactionTimeout").unwrap(), ); module_id.into() }); /// The ModuleId for the subsidy config module pub static SUBSIDY_CONF_MODULE: Lazy<LibraModuleId> = Lazy::new(|| { let module_id = ModuleId::new( account_config::mint_address(), Identifier::new("SubsidyConfig").unwrap(), ); module_id.into() }); /// The ModuleId for the libra block module pub static LIBRA_BLOCK_MODULE: Lazy<LibraModuleId> = Lazy::new(|| { let module_id = ModuleId::new( account_config::core_code_address(), Identifier::new("LibraBlock").unwrap(), ); module_id.into() }); /// The ModuleId for the gas schedule module pub static GAS_SCHEDULE_MODULE: Lazy<LibraModuleId> = Lazy::new(|| { let module_id = ModuleId::new( account_config::core_code_address(), Identifier::new("GasSchedule").unwrap(), ); module_id.into() }); // Names for special functions and structs pub static CREATE_ACCOUNT_NAME: Lazy<Identifier> = Lazy::new(|| Identifier::new("create_account").unwrap()); pub static PROLOGUE_NAME: Lazy<Identifier> = Lazy::new(|| Identifier::new("prologue").unwrap()); pub static EPILOGUE_NAME: Lazy<Identifier> = Lazy::new(|| Identifier::new("epilogue").unwrap()); pub static BLOCK_PROLOGUE: Lazy<Identifier> = Lazy::new(|| Identifier::new("block_prologue").unwrap());
pub mod config; pub mod database; pub mod logging; pub use self::config::Config; pub use self::database::DB; pub use self::logging::Logger;
#![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct ACTIVATEFLAGS(pub i32); pub const ACTIVATE_WINDOWLESS: ACTIVATEFLAGS = ACTIVATEFLAGS(1i32); impl ::core::convert::From<i32> for ACTIVATEFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for ACTIVATEFLAGS { type Abi = Self; } pub const ACTIVEOBJECT_STRONG: u32 = 0u32; pub const ACTIVEOBJECT_WEAK: u32 = 1u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_System_Com")] pub struct ARRAYDESC { pub tdescElem: super::Com::TYPEDESC, pub cDims: u16, pub rgbounds: [super::Com::SAFEARRAYBOUND; 1], } #[cfg(feature = "Win32_System_Com")] impl ARRAYDESC {} #[cfg(feature = "Win32_System_Com")] impl ::core::default::Default for ARRAYDESC { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_System_Com")] impl ::core::cmp::PartialEq for ARRAYDESC { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_System_Com")] impl ::core::cmp::Eq for ARRAYDESC {} #[cfg(feature = "Win32_System_Com")] unsafe impl ::windows::core::Abi for ARRAYDESC { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct AspectInfo { pub cb: u32, pub dwFlags: u32, } impl AspectInfo {} impl ::core::default::Default for AspectInfo { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for AspectInfo { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("AspectInfo").field("cb", &self.cb).field("dwFlags", &self.dwFlags).finish() } } impl ::core::cmp::PartialEq for AspectInfo { fn eq(&self, other: &Self) -> bool { self.cb == other.cb && self.dwFlags == other.dwFlags } } impl ::core::cmp::Eq for AspectInfo {} unsafe impl ::windows::core::Abi for AspectInfo { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct AspectInfoFlag(pub i32); pub const DVASPECTINFOFLAG_CANOPTIMIZE: AspectInfoFlag = AspectInfoFlag(1i32); impl ::core::convert::From<i32> for AspectInfoFlag { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for AspectInfoFlag { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct BINDSPEED(pub i32); pub const BINDSPEED_INDEFINITE: BINDSPEED = BINDSPEED(1i32); pub const BINDSPEED_MODERATE: BINDSPEED = BINDSPEED(2i32); pub const BINDSPEED_IMMEDIATE: BINDSPEED = BINDSPEED(3i32); impl ::core::convert::From<i32> for BINDSPEED { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for BINDSPEED { type Abi = Self; } pub const BZ_DISABLECANCELBUTTON: i32 = 1i32; pub const BZ_DISABLERETRYBUTTON: i32 = 4i32; pub const BZ_DISABLESWITCHTOBUTTON: i32 = 2i32; pub const BZ_NOTRESPONDINGDIALOG: i32 = 8i32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn BstrFromVector(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BstrFromVector(psa: *const super::Com::SAFEARRAY, pbstr: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); BstrFromVector(::core::mem::transmute(psa), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct CADWORD { pub cElems: u32, pub pElems: *mut u32, } impl CADWORD {} impl ::core::default::Default for CADWORD { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for CADWORD { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CADWORD").field("cElems", &self.cElems).field("pElems", &self.pElems).finish() } } impl ::core::cmp::PartialEq for CADWORD { fn eq(&self, other: &Self) -> bool { self.cElems == other.cElems && self.pElems == other.pElems } } impl ::core::cmp::Eq for CADWORD {} unsafe impl ::windows::core::Abi for CADWORD { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct CALPOLESTR { pub cElems: u32, pub pElems: *mut super::super::Foundation::PWSTR, } #[cfg(feature = "Win32_Foundation")] impl CALPOLESTR {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for CALPOLESTR { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for CALPOLESTR { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CALPOLESTR").field("cElems", &self.cElems).field("pElems", &self.pElems).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for CALPOLESTR { fn eq(&self, other: &Self) -> bool { self.cElems == other.cElems && self.pElems == other.pElems } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for CALPOLESTR {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for CALPOLESTR { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct CAUUID { pub cElems: u32, pub pElems: *mut ::windows::core::GUID, } impl CAUUID {} impl ::core::default::Default for CAUUID { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for CAUUID { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CAUUID").field("cElems", &self.cElems).field("pElems", &self.pElems).finish() } } impl ::core::cmp::PartialEq for CAUUID { fn eq(&self, other: &Self) -> bool { self.cElems == other.cElems && self.pElems == other.pElems } } impl ::core::cmp::Eq for CAUUID {} unsafe impl ::windows::core::Abi for CAUUID { type Abi = Self; } pub const CF_CONVERTONLY: i32 = 256i32; pub const CF_DISABLEACTIVATEAS: i32 = 64i32; pub const CF_DISABLEDISPLAYASICON: i32 = 32i32; pub const CF_HIDECHANGEICON: i32 = 128i32; pub const CF_SELECTACTIVATEAS: i32 = 16i32; pub const CF_SELECTCONVERTTO: i32 = 8i32; pub const CF_SETACTIVATEDEFAULT: i32 = 4i32; pub const CF_SETCONVERTDEFAULT: i32 = 2i32; pub const CF_SHOWHELPBUTTON: i32 = 1i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct CHANGEKIND(pub i32); pub const CHANGEKIND_ADDMEMBER: CHANGEKIND = CHANGEKIND(0i32); pub const CHANGEKIND_DELETEMEMBER: CHANGEKIND = CHANGEKIND(1i32); pub const CHANGEKIND_SETNAMES: CHANGEKIND = CHANGEKIND(2i32); pub const CHANGEKIND_SETDOCUMENTATION: CHANGEKIND = CHANGEKIND(3i32); pub const CHANGEKIND_GENERAL: CHANGEKIND = CHANGEKIND(4i32); pub const CHANGEKIND_INVALIDATE: CHANGEKIND = CHANGEKIND(5i32); pub const CHANGEKIND_CHANGEFAILED: CHANGEKIND = CHANGEKIND(6i32); pub const CHANGEKIND_MAX: CHANGEKIND = CHANGEKIND(7i32); impl ::core::convert::From<i32> for CHANGEKIND { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for CHANGEKIND { type Abi = Self; } pub const CIF_SELECTCURRENT: i32 = 2i32; pub const CIF_SELECTDEFAULT: i32 = 4i32; pub const CIF_SELECTFROMFILE: i32 = 8i32; pub const CIF_SHOWHELP: i32 = 1i32; pub const CIF_USEICONEXE: i32 = 16i32; #[derive(:: core :: clone :: Clone)] #[repr(C)] pub struct CLEANLOCALSTORAGE { pub pInterface: ::core::option::Option<::windows::core::IUnknown>, pub pStorage: *mut ::core::ffi::c_void, pub flags: u32, } impl CLEANLOCALSTORAGE {} impl ::core::default::Default for CLEANLOCALSTORAGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for CLEANLOCALSTORAGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CLEANLOCALSTORAGE").field("pInterface", &self.pInterface).field("pStorage", &self.pStorage).field("flags", &self.flags).finish() } } impl ::core::cmp::PartialEq for CLEANLOCALSTORAGE { fn eq(&self, other: &Self) -> bool { self.pInterface == other.pInterface && self.pStorage == other.pStorage && self.flags == other.flags } } impl ::core::cmp::Eq for CLEANLOCALSTORAGE {} unsafe impl ::windows::core::Abi for CLEANLOCALSTORAGE { type Abi = ::core::mem::ManuallyDrop<Self>; } pub const CLSID_CColorPropPage: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0be35201_8f91_11ce_9de3_00aa004bb851); pub const CLSID_CFontPropPage: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0be35200_8f91_11ce_9de3_00aa004bb851); pub const CLSID_CPicturePropPage: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0be35202_8f91_11ce_9de3_00aa004bb851); pub const CLSID_ConvertVBX: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfb8f0822_0164_101b_84ed_08002b2ec713); pub const CLSID_PersistPropset: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfb8f0821_0164_101b_84ed_08002b2ec713); pub const CLSID_StdFont: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0be35203_8f91_11ce_9de3_00aa004bb851); pub const CLSID_StdPicture: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0be35204_8f91_11ce_9de3_00aa004bb851); pub const CONNECT_E_ADVISELIMIT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220991i32 as _); pub const CONNECT_E_CANNOTCONNECT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220990i32 as _); pub const CONNECT_E_FIRST: i32 = -2147220992i32; pub const CONNECT_E_LAST: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220977i32 as _); pub const CONNECT_E_NOCONNECTION: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220992i32 as _); pub const CONNECT_E_OVERRIDDEN: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220989i32 as _); pub const CONNECT_S_FIRST: ::windows::core::HRESULT = ::windows::core::HRESULT(262656i32 as _); pub const CONNECT_S_LAST: ::windows::core::HRESULT = ::windows::core::HRESULT(262671i32 as _); #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub struct CONTROLINFO { pub cb: u32, pub hAccel: super::super::UI::WindowsAndMessaging::HACCEL, pub cAccel: u16, pub dwFlags: u32, } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] impl CONTROLINFO {} #[cfg(feature = "Win32_UI_WindowsAndMessaging")] impl ::core::default::Default for CONTROLINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] impl ::core::fmt::Debug for CONTROLINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CONTROLINFO").field("cb", &self.cb).field("hAccel", &self.hAccel).field("cAccel", &self.cAccel).field("dwFlags", &self.dwFlags).finish() } } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] impl ::core::cmp::PartialEq for CONTROLINFO { fn eq(&self, other: &Self) -> bool { self.cb == other.cb && self.hAccel == other.hAccel && self.cAccel == other.cAccel && self.dwFlags == other.dwFlags } } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] impl ::core::cmp::Eq for CONTROLINFO {} #[cfg(feature = "Win32_UI_WindowsAndMessaging")] unsafe impl ::windows::core::Abi for CONTROLINFO { type Abi = Self; } pub const CSF_EXPLORER: i32 = 8i32; pub const CSF_ONLYGETSOURCE: i32 = 4i32; pub const CSF_SHOWHELP: i32 = 1i32; pub const CSF_VALIDSOURCE: i32 = 2i32; pub const CTL_E_ILLEGALFUNCTIONCALL: i32 = -2146828283i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct CTRLINFO(pub i32); pub const CTRLINFO_EATS_RETURN: CTRLINFO = CTRLINFO(1i32); pub const CTRLINFO_EATS_ESCAPE: CTRLINFO = CTRLINFO(2i32); impl ::core::convert::From<i32> for CTRLINFO { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for CTRLINFO { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn ClearCustData(pcustdata: *mut super::Com::CUSTDATA) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ClearCustData(pcustdata: *mut super::Com::CUSTDATA); } ::core::mem::transmute(ClearCustData(::core::mem::transmute(pcustdata))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn CreateDispTypeInfo(pidata: *mut INTERFACEDATA, lcid: u32, pptinfo: *mut ::core::option::Option<super::Com::ITypeInfo>) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateDispTypeInfo(pidata: *mut INTERFACEDATA, lcid: u32, pptinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } CreateDispTypeInfo(::core::mem::transmute(pidata), ::core::mem::transmute(lcid), ::core::mem::transmute(pptinfo)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn CreateErrorInfo() -> ::windows::core::Result<ICreateErrorInfo> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateErrorInfo(pperrinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <ICreateErrorInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); CreateErrorInfo(&mut result__).from_abi::<ICreateErrorInfo>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn CreateOleAdviseHolder() -> ::windows::core::Result<IOleAdviseHolder> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateOleAdviseHolder(ppoaholder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <IOleAdviseHolder as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); CreateOleAdviseHolder(&mut result__).from_abi::<IOleAdviseHolder>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn CreateStdDispatch<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param2: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>>(punkouter: Param0, pvthis: *mut ::core::ffi::c_void, ptinfo: Param2, ppunkstddisp: *mut ::core::option::Option<::windows::core::IUnknown>) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateStdDispatch(punkouter: ::windows::core::RawPtr, pvthis: *mut ::core::ffi::c_void, ptinfo: ::windows::core::RawPtr, ppunkstddisp: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } CreateStdDispatch(punkouter.into_param().abi(), ::core::mem::transmute(pvthis), ptinfo.into_param().abi(), ::core::mem::transmute(ppunkstddisp)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn CreateTypeLib<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(syskind: super::Com::SYSKIND, szfile: Param1) -> ::windows::core::Result<ICreateTypeLib> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateTypeLib(syskind: super::Com::SYSKIND, szfile: super::super::Foundation::PWSTR, ppctlib: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <ICreateTypeLib as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); CreateTypeLib(::core::mem::transmute(syskind), szfile.into_param().abi(), &mut result__).from_abi::<ICreateTypeLib>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn CreateTypeLib2<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(syskind: super::Com::SYSKIND, szfile: Param1) -> ::windows::core::Result<ICreateTypeLib2> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateTypeLib2(syskind: super::Com::SYSKIND, szfile: super::super::Foundation::PWSTR, ppctlib: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <ICreateTypeLib2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); CreateTypeLib2(::core::mem::transmute(syskind), szfile.into_param().abi(), &mut result__).from_abi::<ICreateTypeLib2>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const DD_DEFDRAGDELAY: u32 = 200u32; pub const DD_DEFDRAGMINDIST: u32 = 2u32; pub const DD_DEFSCROLLDELAY: u32 = 50u32; pub const DD_DEFSCROLLINSET: u32 = 11u32; pub const DD_DEFSCROLLINTERVAL: u32 = 50u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct DISCARDCACHE(pub i32); pub const DISCARDCACHE_SAVEIFDIRTY: DISCARDCACHE = DISCARDCACHE(0i32); pub const DISCARDCACHE_NOSAVE: DISCARDCACHE = DISCARDCACHE(1i32); impl ::core::convert::From<i32> for DISCARDCACHE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DISCARDCACHE { type Abi = Self; } pub const DISPATCH_CONSTRUCT: u32 = 16384u32; pub const DISPATCH_METHOD: u32 = 1u32; pub const DISPATCH_PROPERTYGET: u32 = 2u32; pub const DISPATCH_PROPERTYPUT: u32 = 4u32; pub const DISPATCH_PROPERTYPUTREF: u32 = 8u32; pub const DISPID_ABOUTBOX: i32 = -552i32; pub const DISPID_ACCELERATOR: i32 = -543i32; pub const DISPID_ADDITEM: i32 = -553i32; pub const DISPID_AMBIENT_APPEARANCE: i32 = -716i32; pub const DISPID_AMBIENT_AUTOCLIP: i32 = -715i32; pub const DISPID_AMBIENT_BACKCOLOR: i32 = -701i32; pub const DISPID_AMBIENT_CHARSET: i32 = -727i32; pub const DISPID_AMBIENT_CODEPAGE: i32 = -725i32; pub const DISPID_AMBIENT_DISPLAYASDEFAULT: i32 = -713i32; pub const DISPID_AMBIENT_DISPLAYNAME: i32 = -702i32; pub const DISPID_AMBIENT_FONT: i32 = -703i32; pub const DISPID_AMBIENT_FORECOLOR: i32 = -704i32; pub const DISPID_AMBIENT_LOCALEID: i32 = -705i32; pub const DISPID_AMBIENT_MESSAGEREFLECT: i32 = -706i32; pub const DISPID_AMBIENT_PALETTE: i32 = -726i32; pub const DISPID_AMBIENT_RIGHTTOLEFT: i32 = -732i32; pub const DISPID_AMBIENT_SCALEUNITS: i32 = -707i32; pub const DISPID_AMBIENT_SHOWGRABHANDLES: i32 = -711i32; pub const DISPID_AMBIENT_SHOWHATCHING: i32 = -712i32; pub const DISPID_AMBIENT_SUPPORTSMNEMONICS: i32 = -714i32; pub const DISPID_AMBIENT_TEXTALIGN: i32 = -708i32; pub const DISPID_AMBIENT_TOPTOBOTTOM: i32 = -733i32; pub const DISPID_AMBIENT_TRANSFERPRIORITY: i32 = -728i32; pub const DISPID_AMBIENT_UIDEAD: i32 = -710i32; pub const DISPID_AMBIENT_USERMODE: i32 = -709i32; pub const DISPID_APPEARANCE: i32 = -520i32; pub const DISPID_AUTOSIZE: i32 = -500i32; pub const DISPID_BACKCOLOR: i32 = -501i32; pub const DISPID_BACKSTYLE: i32 = -502i32; pub const DISPID_BORDERCOLOR: i32 = -503i32; pub const DISPID_BORDERSTYLE: i32 = -504i32; pub const DISPID_BORDERVISIBLE: i32 = -519i32; pub const DISPID_BORDERWIDTH: i32 = -505i32; pub const DISPID_CAPTION: i32 = -518i32; pub const DISPID_CLEAR: i32 = -554i32; pub const DISPID_CLICK: i32 = -600i32; pub const DISPID_CLICK_VALUE: i32 = -610i32; pub const DISPID_COLLECT: i32 = -8i32; pub const DISPID_COLUMN: i32 = -529i32; pub const DISPID_CONSTRUCTOR: i32 = -6i32; pub const DISPID_DBLCLICK: i32 = -601i32; pub const DISPID_DESTRUCTOR: i32 = -7i32; pub const DISPID_DISPLAYSTYLE: i32 = -540i32; pub const DISPID_DOCLICK: i32 = -551i32; pub const DISPID_DRAWMODE: i32 = -507i32; pub const DISPID_DRAWSTYLE: i32 = -508i32; pub const DISPID_DRAWWIDTH: i32 = -509i32; pub const DISPID_Delete: i32 = -801i32; pub const DISPID_ENABLED: i32 = -514i32; pub const DISPID_ENTERKEYBEHAVIOR: i32 = -544i32; pub const DISPID_ERROREVENT: i32 = -608i32; pub const DISPID_EVALUATE: i32 = -5i32; pub const DISPID_FILLCOLOR: i32 = -510i32; pub const DISPID_FILLSTYLE: i32 = -511i32; pub const DISPID_FONT: i32 = -512i32; pub const DISPID_FONT_BOLD: u32 = 3u32; pub const DISPID_FONT_CHANGED: u32 = 9u32; pub const DISPID_FONT_CHARSET: u32 = 8u32; pub const DISPID_FONT_ITALIC: u32 = 4u32; pub const DISPID_FONT_NAME: u32 = 0u32; pub const DISPID_FONT_SIZE: u32 = 2u32; pub const DISPID_FONT_STRIKE: u32 = 6u32; pub const DISPID_FONT_UNDER: u32 = 5u32; pub const DISPID_FONT_WEIGHT: u32 = 7u32; pub const DISPID_FORECOLOR: i32 = -513i32; pub const DISPID_GROUPNAME: i32 = -541i32; pub const DISPID_HWND: i32 = -515i32; pub const DISPID_IMEMODE: i32 = -542i32; pub const DISPID_KEYDOWN: i32 = -602i32; pub const DISPID_KEYPRESS: i32 = -603i32; pub const DISPID_KEYUP: i32 = -604i32; pub const DISPID_LIST: i32 = -528i32; pub const DISPID_LISTCOUNT: i32 = -531i32; pub const DISPID_LISTINDEX: i32 = -526i32; pub const DISPID_MAXLENGTH: i32 = -533i32; pub const DISPID_MOUSEDOWN: i32 = -605i32; pub const DISPID_MOUSEICON: i32 = -522i32; pub const DISPID_MOUSEMOVE: i32 = -606i32; pub const DISPID_MOUSEPOINTER: i32 = -521i32; pub const DISPID_MOUSEUP: i32 = -607i32; pub const DISPID_MULTILINE: i32 = -537i32; pub const DISPID_MULTISELECT: i32 = -532i32; pub const DISPID_NEWENUM: i32 = -4i32; pub const DISPID_NUMBEROFCOLUMNS: i32 = -539i32; pub const DISPID_NUMBEROFROWS: i32 = -538i32; pub const DISPID_Name: i32 = -800i32; pub const DISPID_Object: i32 = -802i32; pub const DISPID_PASSWORDCHAR: i32 = -534i32; pub const DISPID_PICTURE: i32 = -523i32; pub const DISPID_PICT_HANDLE: u32 = 0u32; pub const DISPID_PICT_HEIGHT: u32 = 5u32; pub const DISPID_PICT_HPAL: u32 = 2u32; pub const DISPID_PICT_RENDER: u32 = 6u32; pub const DISPID_PICT_TYPE: u32 = 3u32; pub const DISPID_PICT_WIDTH: u32 = 4u32; pub const DISPID_PROPERTYPUT: i32 = -3i32; pub const DISPID_Parent: i32 = -803i32; pub const DISPID_READYSTATE: i32 = -525i32; pub const DISPID_READYSTATECHANGE: i32 = -609i32; pub const DISPID_REFRESH: i32 = -550i32; pub const DISPID_REMOVEITEM: i32 = -555i32; pub const DISPID_RIGHTTOLEFT: i32 = -611i32; pub const DISPID_SCROLLBARS: i32 = -535i32; pub const DISPID_SELECTED: i32 = -527i32; pub const DISPID_SELLENGTH: i32 = -548i32; pub const DISPID_SELSTART: i32 = -547i32; pub const DISPID_SELTEXT: i32 = -546i32; pub const DISPID_STARTENUM: i32 = -1i32; pub const DISPID_TABKEYBEHAVIOR: i32 = -545i32; pub const DISPID_TABSTOP: i32 = -516i32; pub const DISPID_TEXT: i32 = -517i32; pub const DISPID_THIS: i32 = -613i32; pub const DISPID_TOPTOBOTTOM: i32 = -612i32; pub const DISPID_UNKNOWN: i32 = -1i32; pub const DISPID_VALID: i32 = -524i32; pub const DISPID_VALUE: u32 = 0u32; pub const DISPID_WORDWRAP: i32 = -536i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct DOCMISC(pub i32); pub const DOCMISC_CANCREATEMULTIPLEVIEWS: DOCMISC = DOCMISC(1i32); pub const DOCMISC_SUPPORTCOMPLEXRECTANGLES: DOCMISC = DOCMISC(2i32); pub const DOCMISC_CANTOPENEDIT: DOCMISC = DOCMISC(4i32); pub const DOCMISC_NOFILESUPPORT: DOCMISC = DOCMISC(8i32); impl ::core::convert::From<i32> for DOCMISC { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DOCMISC { type Abi = Self; } pub const DROPEFFECT_COPY: u32 = 1u32; pub const DROPEFFECT_LINK: u32 = 4u32; pub const DROPEFFECT_MOVE: u32 = 2u32; pub const DROPEFFECT_NONE: u32 = 0u32; pub const DROPEFFECT_SCROLL: u32 = 2147483648u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct DVASPECT2(pub i32); pub const DVASPECT_OPAQUE: DVASPECT2 = DVASPECT2(16i32); pub const DVASPECT_TRANSPARENT: DVASPECT2 = DVASPECT2(32i32); impl ::core::convert::From<i32> for DVASPECT2 { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DVASPECT2 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn DispCallFunc(pvinstance: *const ::core::ffi::c_void, ovft: usize, cc: super::Com::CALLCONV, vtreturn: u16, cactuals: u32, prgvt: *const u16, prgpvarg: *const *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DispCallFunc(pvinstance: *const ::core::ffi::c_void, ovft: usize, cc: super::Com::CALLCONV, vtreturn: u16, cactuals: u32, prgvt: *const u16, prgpvarg: *const *const super::Com::VARIANT, pvargresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); DispCallFunc(::core::mem::transmute(pvinstance), ::core::mem::transmute(ovft), ::core::mem::transmute(cc), ::core::mem::transmute(vtreturn), ::core::mem::transmute(cactuals), ::core::mem::transmute(prgvt), ::core::mem::transmute(prgpvarg), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn DispGetIDsOfNames<'a, Param0: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>>(ptinfo: Param0, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32, rgdispid: *mut i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DispGetIDsOfNames(ptinfo: ::windows::core::RawPtr, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32, rgdispid: *mut i32) -> ::windows::core::HRESULT; } DispGetIDsOfNames(ptinfo.into_param().abi(), ::core::mem::transmute(rgsznames), ::core::mem::transmute(cnames), ::core::mem::transmute(rgdispid)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn DispGetParam(pdispparams: *const super::Com::DISPPARAMS, position: u32, vttarg: u16, pvarresult: *mut super::Com::VARIANT, puargerr: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DispGetParam(pdispparams: *const super::Com::DISPPARAMS, position: u32, vttarg: u16, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, puargerr: *mut u32) -> ::windows::core::HRESULT; } DispGetParam(::core::mem::transmute(pdispparams), ::core::mem::transmute(position), ::core::mem::transmute(vttarg), ::core::mem::transmute(pvarresult), ::core::mem::transmute(puargerr)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn DispInvoke<'a, Param1: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>>(_this: *mut ::core::ffi::c_void, ptinfo: Param1, dispidmember: i32, wflags: u16, pparams: *mut super::Com::DISPPARAMS, pvarresult: *mut super::Com::VARIANT, pexcepinfo: *mut super::Com::EXCEPINFO, puargerr: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DispInvoke(_this: *mut ::core::ffi::c_void, ptinfo: ::windows::core::RawPtr, dispidmember: i32, wflags: u16, pparams: *mut super::Com::DISPPARAMS, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pexcepinfo: *mut ::core::mem::ManuallyDrop<super::Com::EXCEPINFO>, puargerr: *mut u32) -> ::windows::core::HRESULT; } DispInvoke(::core::mem::transmute(_this), ptinfo.into_param().abi(), ::core::mem::transmute(dispidmember), ::core::mem::transmute(wflags), ::core::mem::transmute(pparams), ::core::mem::transmute(pvarresult), ::core::mem::transmute(pexcepinfo), ::core::mem::transmute(puargerr)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn DoDragDrop<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param1: ::windows::core::IntoParam<'a, IDropSource>>(pdataobj: Param0, pdropsource: Param1, dwokeffects: u32, pdweffect: *mut u32) -> ::windows::core::HRESULT { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DoDragDrop(pdataobj: ::windows::core::RawPtr, pdropsource: ::windows::core::RawPtr, dwokeffects: u32, pdweffect: *mut u32) -> ::windows::core::HRESULT; } ::core::mem::transmute(DoDragDrop(pdataobj.into_param().abi(), pdropsource.into_param().abi(), ::core::mem::transmute(dwokeffects), ::core::mem::transmute(pdweffect))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DosDateTimeToVariantTime(wdosdate: u16, wdostime: u16, pvtime: *mut f64) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DosDateTimeToVariantTime(wdosdate: u16, wdostime: u16, pvtime: *mut f64) -> i32; } ::core::mem::transmute(DosDateTimeToVariantTime(::core::mem::transmute(wdosdate), ::core::mem::transmute(wdostime), ::core::mem::transmute(pvtime))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const ELF_DISABLECANCELLINK: i32 = 16i32; pub const ELF_DISABLECHANGESOURCE: i32 = 8i32; pub const ELF_DISABLEOPENSOURCE: i32 = 4i32; pub const ELF_DISABLEUPDATENOW: i32 = 2i32; pub const ELF_SHOWHELP: i32 = 1i32; pub const EMBDHLP_CREATENOW: i32 = 0i32; pub const EMBDHLP_DELAYCREATE: i32 = 65536i32; pub const EMBDHLP_INPROC_HANDLER: i32 = 0i32; pub const EMBDHLP_INPROC_SERVER: i32 = 1i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct ENUM_CONTROLS_WHICH_FLAGS(pub u32); pub const GCW_WCH_SIBLING: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(1u32); pub const GC_WCH_CONTAINER: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(2u32); pub const GC_WCH_CONTAINED: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(3u32); pub const GC_WCH_ALL: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(4u32); pub const GC_WCH_FREVERSEDIR: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(134217728u32); pub const GC_WCH_FONLYAFTER: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(268435456u32); pub const GC_WCH_FONLYBEFORE: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(536870912u32); pub const GC_WCH_FSELECTED: ENUM_CONTROLS_WHICH_FLAGS = ENUM_CONTROLS_WHICH_FLAGS(1073741824u32); impl ::core::convert::From<u32> for ENUM_CONTROLS_WHICH_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for ENUM_CONTROLS_WHICH_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for ENUM_CONTROLS_WHICH_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for ENUM_CONTROLS_WHICH_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for ENUM_CONTROLS_WHICH_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for ENUM_CONTROLS_WHICH_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for ENUM_CONTROLS_WHICH_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct ExtentInfo { pub cb: u32, pub dwExtentMode: u32, pub sizelProposed: super::super::Foundation::SIZE, } #[cfg(feature = "Win32_Foundation")] impl ExtentInfo {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for ExtentInfo { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for ExtentInfo { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("ExtentInfo").field("cb", &self.cb).field("dwExtentMode", &self.dwExtentMode).field("sizelProposed", &self.sizelProposed).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for ExtentInfo { fn eq(&self, other: &Self) -> bool { self.cb == other.cb && self.dwExtentMode == other.dwExtentMode && self.sizelProposed == other.sizelProposed } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for ExtentInfo {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for ExtentInfo { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct ExtentMode(pub i32); pub const DVEXTENT_CONTENT: ExtentMode = ExtentMode(0i32); pub const DVEXTENT_INTEGRAL: ExtentMode = ExtentMode(1i32); impl ::core::convert::From<i32> for ExtentMode { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for ExtentMode { type Abi = Self; } pub const FADF_AUTO: u32 = 1u32; pub const FADF_BSTR: u32 = 256u32; pub const FADF_DISPATCH: u32 = 1024u32; pub const FADF_EMBEDDED: u32 = 4u32; pub const FADF_FIXEDSIZE: u32 = 16u32; pub const FADF_HAVEIID: u32 = 64u32; pub const FADF_HAVEVARTYPE: u32 = 128u32; pub const FADF_RECORD: u32 = 32u32; pub const FADF_RESERVED: u32 = 61448u32; pub const FADF_STATIC: u32 = 2u32; pub const FADF_UNKNOWN: u32 = 512u32; pub const FADF_VARIANT: u32 = 2048u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct FONTDESC { pub cbSizeofstruct: u32, pub lpstrName: super::super::Foundation::PWSTR, pub cySize: super::Com::CY, pub sWeight: i16, pub sCharset: i16, pub fItalic: super::super::Foundation::BOOL, pub fUnderline: super::super::Foundation::BOOL, pub fStrikethrough: super::super::Foundation::BOOL, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl FONTDESC {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for FONTDESC { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for FONTDESC { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for FONTDESC {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for FONTDESC { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct FUNCFLAGS(pub i32); pub const FUNCFLAG_FRESTRICTED: FUNCFLAGS = FUNCFLAGS(1i32); pub const FUNCFLAG_FSOURCE: FUNCFLAGS = FUNCFLAGS(2i32); pub const FUNCFLAG_FBINDABLE: FUNCFLAGS = FUNCFLAGS(4i32); pub const FUNCFLAG_FREQUESTEDIT: FUNCFLAGS = FUNCFLAGS(8i32); pub const FUNCFLAG_FDISPLAYBIND: FUNCFLAGS = FUNCFLAGS(16i32); pub const FUNCFLAG_FDEFAULTBIND: FUNCFLAGS = FUNCFLAGS(32i32); pub const FUNCFLAG_FHIDDEN: FUNCFLAGS = FUNCFLAGS(64i32); pub const FUNCFLAG_FUSESGETLASTERROR: FUNCFLAGS = FUNCFLAGS(128i32); pub const FUNCFLAG_FDEFAULTCOLLELEM: FUNCFLAGS = FUNCFLAGS(256i32); pub const FUNCFLAG_FUIDEFAULT: FUNCFLAGS = FUNCFLAGS(512i32); pub const FUNCFLAG_FNONBROWSABLE: FUNCFLAGS = FUNCFLAGS(1024i32); pub const FUNCFLAG_FREPLACEABLE: FUNCFLAGS = FUNCFLAGS(2048i32); pub const FUNCFLAG_FIMMEDIATEBIND: FUNCFLAGS = FUNCFLAGS(4096i32); impl ::core::convert::From<i32> for FUNCFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for FUNCFLAGS { type Abi = Self; } pub const GC_WCH_SIBLING: i32 = 1i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct GUIDKIND(pub i32); pub const GUIDKIND_DEFAULT_SOURCE_DISP_IID: GUIDKIND = GUIDKIND(1i32); impl ::core::convert::From<i32> for GUIDKIND { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for GUIDKIND { type Abi = Self; } pub const GUID_CHECKVALUEEXCLUSIVE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6650430c_be0f_101a_8bbb_00aa00300cab); pub const GUID_COLOR: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504301_be0f_101a_8bbb_00aa00300cab); pub const GUID_FONTBOLD: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6650430f_be0f_101a_8bbb_00aa00300cab); pub const GUID_FONTITALIC: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504310_be0f_101a_8bbb_00aa00300cab); pub const GUID_FONTNAME: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6650430d_be0f_101a_8bbb_00aa00300cab); pub const GUID_FONTSIZE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6650430e_be0f_101a_8bbb_00aa00300cab); pub const GUID_FONTSTRIKETHROUGH: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504312_be0f_101a_8bbb_00aa00300cab); pub const GUID_FONTUNDERSCORE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504311_be0f_101a_8bbb_00aa00300cab); pub const GUID_HANDLE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504313_be0f_101a_8bbb_00aa00300cab); pub const GUID_HIMETRIC: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504300_be0f_101a_8bbb_00aa00300cab); pub const GUID_OPTIONVALUEEXCLUSIVE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6650430b_be0f_101a_8bbb_00aa00300cab); pub const GUID_TRISTATE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6650430a_be0f_101a_8bbb_00aa00300cab); pub const GUID_XPOS: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504306_be0f_101a_8bbb_00aa00300cab); pub const GUID_XPOSPIXEL: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504302_be0f_101a_8bbb_00aa00300cab); pub const GUID_XSIZE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504308_be0f_101a_8bbb_00aa00300cab); pub const GUID_XSIZEPIXEL: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504304_be0f_101a_8bbb_00aa00300cab); pub const GUID_YPOS: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504307_be0f_101a_8bbb_00aa00300cab); pub const GUID_YPOSPIXEL: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504303_be0f_101a_8bbb_00aa00300cab); pub const GUID_YSIZE: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504309_be0f_101a_8bbb_00aa00300cab); pub const GUID_YSIZEPIXEL: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x66504305_be0f_101a_8bbb_00aa00300cab); #[inline] pub unsafe fn GetActiveObject(rclsid: *const ::windows::core::GUID, pvreserved: *mut ::core::ffi::c_void, ppunk: *mut ::core::option::Option<::windows::core::IUnknown>) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetActiveObject(rclsid: *const ::windows::core::GUID, pvreserved: *mut ::core::ffi::c_void, ppunk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } GetActiveObject(::core::mem::transmute(rclsid), ::core::mem::transmute(pvreserved), ::core::mem::transmute(ppunk)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetAltMonthNames(lcid: u32) -> ::windows::core::Result<*mut super::super::Foundation::PWSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetAltMonthNames(lcid: u32, prgp: *mut *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT; } let mut result__: <*mut super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetAltMonthNames(::core::mem::transmute(lcid), &mut result__).from_abi::<*mut super::super::Foundation::PWSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetRecordInfoFromGuids(rguidtypelib: *const ::windows::core::GUID, uvermajor: u32, uverminor: u32, lcid: u32, rguidtypeinfo: *const ::windows::core::GUID) -> ::windows::core::Result<IRecordInfo> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetRecordInfoFromGuids(rguidtypelib: *const ::windows::core::GUID, uvermajor: u32, uverminor: u32, lcid: u32, rguidtypeinfo: *const ::windows::core::GUID, pprecinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <IRecordInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetRecordInfoFromGuids(::core::mem::transmute(rguidtypelib), ::core::mem::transmute(uvermajor), ::core::mem::transmute(uverminor), ::core::mem::transmute(lcid), ::core::mem::transmute(rguidtypeinfo), &mut result__).from_abi::<IRecordInfo>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn GetRecordInfoFromTypeInfo<'a, Param0: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>>(ptypeinfo: Param0) -> ::windows::core::Result<IRecordInfo> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetRecordInfoFromTypeInfo(ptypeinfo: ::windows::core::RawPtr, pprecinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <IRecordInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetRecordInfoFromTypeInfo(ptypeinfo.into_param().abi(), &mut result__).from_abi::<IRecordInfo>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct HITRESULT(pub i32); pub const HITRESULT_OUTSIDE: HITRESULT = HITRESULT(0i32); pub const HITRESULT_TRANSPARENT: HITRESULT = HITRESULT(1i32); pub const HITRESULT_CLOSE: HITRESULT = HITRESULT(2i32); pub const HITRESULT_HIT: HITRESULT = HITRESULT(3i32); impl ::core::convert::From<i32> for HITRESULT { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for HITRESULT { type Abi = Self; } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserFree(param0: *const u32, param1: *const super::super::Graphics::Gdi::HRGN) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserFree(param0: *const u32, param1: *const super::super::Graphics::Gdi::HRGN); } ::core::mem::transmute(HRGN_UserFree(::core::mem::transmute(param0), ::core::mem::transmute(param1))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserFree64(param0: *const u32, param1: *const super::super::Graphics::Gdi::HRGN) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserFree64(param0: *const u32, param1: *const super::super::Graphics::Gdi::HRGN); } ::core::mem::transmute(HRGN_UserFree64(::core::mem::transmute(param0), ::core::mem::transmute(param1))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserMarshal(param0: *const u32, param1: *mut u8, param2: *const super::super::Graphics::Gdi::HRGN) -> *mut u8 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserMarshal(param0: *const u32, param1: *mut u8, param2: *const super::super::Graphics::Gdi::HRGN) -> *mut u8; } ::core::mem::transmute(HRGN_UserMarshal(::core::mem::transmute(param0), ::core::mem::transmute(param1), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserMarshal64(param0: *const u32, param1: *mut u8, param2: *const super::super::Graphics::Gdi::HRGN) -> *mut u8 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserMarshal64(param0: *const u32, param1: *mut u8, param2: *const super::super::Graphics::Gdi::HRGN) -> *mut u8; } ::core::mem::transmute(HRGN_UserMarshal64(::core::mem::transmute(param0), ::core::mem::transmute(param1), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserSize(param0: *const u32, param1: u32, param2: *const super::super::Graphics::Gdi::HRGN) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserSize(param0: *const u32, param1: u32, param2: *const super::super::Graphics::Gdi::HRGN) -> u32; } ::core::mem::transmute(HRGN_UserSize(::core::mem::transmute(param0), ::core::mem::transmute(param1), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserSize64(param0: *const u32, param1: u32, param2: *const super::super::Graphics::Gdi::HRGN) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserSize64(param0: *const u32, param1: u32, param2: *const super::super::Graphics::Gdi::HRGN) -> u32; } ::core::mem::transmute(HRGN_UserSize64(::core::mem::transmute(param0), ::core::mem::transmute(param1), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserUnmarshal(param0: *const u32, param1: *const u8, param2: *mut super::super::Graphics::Gdi::HRGN) -> *mut u8 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserUnmarshal(param0: *const u32, param1: *const u8, param2: *mut super::super::Graphics::Gdi::HRGN) -> *mut u8; } ::core::mem::transmute(HRGN_UserUnmarshal(::core::mem::transmute(param0), ::core::mem::transmute(param1), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn HRGN_UserUnmarshal64(param0: *const u32, param1: *const u8, param2: *mut super::super::Graphics::Gdi::HRGN) -> *mut u8 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HRGN_UserUnmarshal64(param0: *const u32, param1: *const u8, param2: *mut super::super::Graphics::Gdi::HRGN) -> *mut u8; } ::core::mem::transmute(HRGN_UserUnmarshal64(::core::mem::transmute(param0), ::core::mem::transmute(param1), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IAdviseSinkEx(pub ::windows::core::IUnknown); impl IAdviseSinkEx { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn OnDataChange(&self, pformatetc: *const super::Com::FORMATETC, pstgmed: *const super::Com::STGMEDIUM) { ::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pformatetc), ::core::mem::transmute(pstgmed))) } pub unsafe fn OnViewChange(&self, dwaspect: u32, lindex: i32) { ::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwaspect), ::core::mem::transmute(lindex))) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn OnRename<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IMoniker>>(&self, pmk: Param0) { ::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), pmk.into_param().abi())) } pub unsafe fn OnSave(&self) { ::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self))) } pub unsafe fn OnClose(&self) { ::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self))) } pub unsafe fn OnViewStatusChange(&self, dwviewstatus: u32) { ::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwviewstatus))) } } unsafe impl ::windows::core::Interface for IAdviseSinkEx { type Vtable = IAdviseSinkEx_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3af24290_0c96_11ce_a0cf_00aa00600ab8); } impl ::core::convert::From<IAdviseSinkEx> for ::windows::core::IUnknown { fn from(value: IAdviseSinkEx) -> Self { value.0 } } impl ::core::convert::From<&IAdviseSinkEx> for ::windows::core::IUnknown { fn from(value: &IAdviseSinkEx) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IAdviseSinkEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IAdviseSinkEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IAdviseSinkEx> for super::Com::IAdviseSink { fn from(value: IAdviseSinkEx) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IAdviseSinkEx> for super::Com::IAdviseSink { fn from(value: &IAdviseSinkEx) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IAdviseSink> for IAdviseSinkEx { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IAdviseSink> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IAdviseSink> for &IAdviseSinkEx { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IAdviseSink> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IAdviseSinkEx_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pformatetc: *const super::Com::FORMATETC, pstgmed: *const ::core::mem::ManuallyDrop<super::Com::STGMEDIUM>), #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwaspect: u32, lindex: i32), #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmk: ::windows::core::RawPtr), #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr), pub unsafe extern "system" fn(this: ::windows::core::RawPtr), pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwviewstatus: u32), ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ICanHandleException(pub ::windows::core::IUnknown); impl ICanHandleException { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn CanHandleException(&self, pexcepinfo: *const super::Com::EXCEPINFO, pvar: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pexcepinfo), ::core::mem::transmute(pvar)).ok() } } unsafe impl ::windows::core::Interface for ICanHandleException { type Vtable = ICanHandleException_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc5598e60_b307_11d1_b27d_006008c3fbfb); } impl ::core::convert::From<ICanHandleException> for ::windows::core::IUnknown { fn from(value: ICanHandleException) -> Self { value.0 } } impl ::core::convert::From<&ICanHandleException> for ::windows::core::IUnknown { fn from(value: &ICanHandleException) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ICanHandleException { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ICanHandleException { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ICanHandleException_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pexcepinfo: *const ::core::mem::ManuallyDrop<super::Com::EXCEPINFO>, pvar: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IClassFactory2(pub ::windows::core::IUnknown); impl IClassFactory2 { pub unsafe fn CreateInstance<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, T: ::windows::core::Interface>(&self, punkouter: Param0) -> ::windows::core::Result<T> { let mut result__ = ::core::option::Option::None; (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), punkouter.into_param().abi(), &<T as ::windows::core::Interface>::IID, &mut result__ as *mut _ as *mut _).and_some(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn LockServer<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, flock: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), flock.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLicInfo(&self, plicinfo: *mut LICINFO) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(plicinfo)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn RequestLicKey(&self, dwreserved: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwreserved), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn CreateInstanceLic<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(&self, punkouter: Param0, punkreserved: Param1, riid: *const ::windows::core::GUID, bstrkey: Param3, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), punkouter.into_param().abi(), punkreserved.into_param().abi(), ::core::mem::transmute(riid), bstrkey.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } } unsafe impl ::windows::core::Interface for IClassFactory2 { type Vtable = IClassFactory2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb196b28f_bab4_101a_b69c_00aa00341d07); } impl ::core::convert::From<IClassFactory2> for ::windows::core::IUnknown { fn from(value: IClassFactory2) -> Self { value.0 } } impl ::core::convert::From<&IClassFactory2> for ::windows::core::IUnknown { fn from(value: &IClassFactory2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IClassFactory2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IClassFactory2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IClassFactory2> for super::Com::IClassFactory { fn from(value: IClassFactory2) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IClassFactory2> for super::Com::IClassFactory { fn from(value: &IClassFactory2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IClassFactory> for IClassFactory2 { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IClassFactory> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IClassFactory> for &IClassFactory2 { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IClassFactory> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IClassFactory2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punkouter: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppvobject: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flock: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, plicinfo: *mut LICINFO) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwreserved: u32, pbstrkey: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punkouter: ::windows::core::RawPtr, punkreserved: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, bstrkey: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IContinue(pub ::windows::core::IUnknown); impl IContinue { pub unsafe fn FContinue(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IContinue { type Vtable = IContinue_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000012a_0000_0000_c000_000000000046); } impl ::core::convert::From<IContinue> for ::windows::core::IUnknown { fn from(value: IContinue) -> Self { value.0 } } impl ::core::convert::From<&IContinue> for ::windows::core::IUnknown { fn from(value: &IContinue) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IContinue { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IContinue { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IContinue_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IContinueCallback(pub ::windows::core::IUnknown); impl IContinueCallback { pub unsafe fn FContinue(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn FContinuePrinting<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, ncntprinted: i32, ncurpage: i32, pwszprintstatus: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(ncntprinted), ::core::mem::transmute(ncurpage), pwszprintstatus.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IContinueCallback { type Vtable = IContinueCallback_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb722bcca_4e68_101b_a2bc_00aa00404770); } impl ::core::convert::From<IContinueCallback> for ::windows::core::IUnknown { fn from(value: IContinueCallback) -> Self { value.0 } } impl ::core::convert::From<&IContinueCallback> for ::windows::core::IUnknown { fn from(value: &IContinueCallback) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IContinueCallback { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IContinueCallback { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IContinueCallback_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ncntprinted: i32, ncurpage: i32, pwszprintstatus: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ICreateErrorInfo(pub ::windows::core::IUnknown); impl ICreateErrorInfo { pub unsafe fn SetGUID(&self, rguid: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(rguid)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetSource<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szsource: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), szsource.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetDescription<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szdescription: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), szdescription.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetHelpFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szhelpfile: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), szhelpfile.into_param().abi()).ok() } pub unsafe fn SetHelpContext(&self, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwhelpcontext)).ok() } } unsafe impl ::windows::core::Interface for ICreateErrorInfo { type Vtable = ICreateErrorInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x22f03340_547d_101b_8e65_08002b2bd119); } impl ::core::convert::From<ICreateErrorInfo> for ::windows::core::IUnknown { fn from(value: ICreateErrorInfo) -> Self { value.0 } } impl ::core::convert::From<&ICreateErrorInfo> for ::windows::core::IUnknown { fn from(value: &ICreateErrorInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ICreateErrorInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ICreateErrorInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ICreateErrorInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, rguid: *const ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szsource: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szdescription: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szhelpfile: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwhelpcontext: u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ICreateTypeInfo(pub ::windows::core::IUnknown); impl ICreateTypeInfo { pub unsafe fn SetGuid(&self, guid: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(guid)).ok() } pub unsafe fn SetTypeFlags(&self, utypeflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(utypeflags)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetDocString<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pstrdoc: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), pstrdoc.into_param().abi()).ok() } pub unsafe fn SetHelpContext(&self, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwhelpcontext)).ok() } pub unsafe fn SetVersion(&self, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(wmajorvernum), ::core::mem::transmute(wminorvernum)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn AddRefTypeInfo<'a, Param0: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>>(&self, ptinfo: Param0, phreftype: *const u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ptinfo.into_param().abi(), ::core::mem::transmute(phreftype)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn AddFuncDesc(&self, index: u32, pfuncdesc: *const super::Com::FUNCDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(pfuncdesc)).ok() } pub unsafe fn AddImplType(&self, index: u32, hreftype: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(hreftype)).ok() } pub unsafe fn SetImplTypeFlags(&self, index: u32, impltypeflags: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(impltypeflags)).ok() } pub unsafe fn SetAlignment(&self, cbalignment: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(cbalignment)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetSchema<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pstrschema: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), pstrschema.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn AddVarDesc(&self, index: u32, pvardesc: *const super::Com::VARDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(pvardesc)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetFuncAndParamNames(&self, index: u32, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(rgsznames), ::core::mem::transmute(cnames)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetVarName<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szname: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szname.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetTypeDescAlias(&self, ptdescalias: *const super::Com::TYPEDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(ptdescalias)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DefineFuncAsDllEntry<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szdllname: Param1, szprocname: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szdllname.into_param().abi(), szprocname.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetFuncDocString<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szdocstring: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szdocstring.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetVarDocString<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szdocstring: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szdocstring.into_param().abi()).ok() } pub unsafe fn SetFuncHelpContext(&self, index: u32, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dwhelpcontext)).ok() } pub unsafe fn SetVarHelpContext(&self, index: u32, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dwhelpcontext)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetMops<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(&self, index: u32, bstrmops: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), bstrmops.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetTypeIdldesc(&self, pidldesc: *const super::Com::IDLDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(pidldesc)).ok() } pub unsafe fn LayOut(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for ICreateTypeInfo { type Vtable = ICreateTypeInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00020405_0000_0000_c000_000000000046); } impl ::core::convert::From<ICreateTypeInfo> for ::windows::core::IUnknown { fn from(value: ICreateTypeInfo) -> Self { value.0 } } impl ::core::convert::From<&ICreateTypeInfo> for ::windows::core::IUnknown { fn from(value: &ICreateTypeInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ICreateTypeInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ICreateTypeInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ICreateTypeInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, guid: *const ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, utypeflags: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstrdoc: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwhelpcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptinfo: ::windows::core::RawPtr, phreftype: *const u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, pfuncdesc: *const super::Com::FUNCDESC) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, hreftype: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, impltypeflags: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cbalignment: u16) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstrschema: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, pvardesc: *const super::Com::VARDESC) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptdescalias: *const super::Com::TYPEDESC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szdllname: super::super::Foundation::PWSTR, szprocname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szdocstring: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szdocstring: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dwhelpcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dwhelpcontext: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, bstrmops: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pidldesc: *const super::Com::IDLDESC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ICreateTypeInfo2(pub ::windows::core::IUnknown); impl ICreateTypeInfo2 { pub unsafe fn SetGuid(&self, guid: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(guid)).ok() } pub unsafe fn SetTypeFlags(&self, utypeflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(utypeflags)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetDocString<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pstrdoc: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), pstrdoc.into_param().abi()).ok() } pub unsafe fn SetHelpContext(&self, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwhelpcontext)).ok() } pub unsafe fn SetVersion(&self, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(wmajorvernum), ::core::mem::transmute(wminorvernum)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn AddRefTypeInfo<'a, Param0: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>>(&self, ptinfo: Param0, phreftype: *const u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ptinfo.into_param().abi(), ::core::mem::transmute(phreftype)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn AddFuncDesc(&self, index: u32, pfuncdesc: *const super::Com::FUNCDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(pfuncdesc)).ok() } pub unsafe fn AddImplType(&self, index: u32, hreftype: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(hreftype)).ok() } pub unsafe fn SetImplTypeFlags(&self, index: u32, impltypeflags: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(impltypeflags)).ok() } pub unsafe fn SetAlignment(&self, cbalignment: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(cbalignment)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetSchema<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pstrschema: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), pstrschema.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn AddVarDesc(&self, index: u32, pvardesc: *const super::Com::VARDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(pvardesc)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetFuncAndParamNames(&self, index: u32, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(rgsznames), ::core::mem::transmute(cnames)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetVarName<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szname: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szname.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetTypeDescAlias(&self, ptdescalias: *const super::Com::TYPEDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(ptdescalias)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DefineFuncAsDllEntry<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szdllname: Param1, szprocname: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szdllname.into_param().abi(), szprocname.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetFuncDocString<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szdocstring: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szdocstring.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetVarDocString<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, index: u32, szdocstring: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), szdocstring.into_param().abi()).ok() } pub unsafe fn SetFuncHelpContext(&self, index: u32, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dwhelpcontext)).ok() } pub unsafe fn SetVarHelpContext(&self, index: u32, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dwhelpcontext)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetMops<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(&self, index: u32, bstrmops: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), bstrmops.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetTypeIdldesc(&self, pidldesc: *const super::Com::IDLDESC) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(pidldesc)).ok() } pub unsafe fn LayOut(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn DeleteFuncDesc(&self, index: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn DeleteFuncDescByMemId(&self, memid: i32, invkind: super::Com::INVOKEKIND) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(memid), ::core::mem::transmute(invkind)).ok() } pub unsafe fn DeleteVarDesc(&self, index: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok() } pub unsafe fn DeleteVarDescByMemId(&self, memid: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(memid)).ok() } pub unsafe fn DeleteImplType(&self, index: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SetCustData(&self, guid: *const ::windows::core::GUID, pvarval: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), ::core::mem::transmute(guid), ::core::mem::transmute(pvarval)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SetFuncCustData(&self, index: u32, guid: *const ::windows::core::GUID, pvarval: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(guid), ::core::mem::transmute(pvarval)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SetParamCustData(&self, indexfunc: u32, indexparam: u32, guid: *const ::windows::core::GUID, pvarval: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(indexfunc), ::core::mem::transmute(indexparam), ::core::mem::transmute(guid), ::core::mem::transmute(pvarval)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SetVarCustData(&self, index: u32, guid: *const ::windows::core::GUID, pvarval: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(guid), ::core::mem::transmute(pvarval)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SetImplTypeCustData(&self, index: u32, guid: *const ::windows::core::GUID, pvarval: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(guid), ::core::mem::transmute(pvarval)).ok() } pub unsafe fn SetHelpStringContext(&self, dwhelpstringcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwhelpstringcontext)).ok() } pub unsafe fn SetFuncHelpStringContext(&self, index: u32, dwhelpstringcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dwhelpstringcontext)).ok() } pub unsafe fn SetVarHelpStringContext(&self, index: u32, dwhelpstringcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dwhelpstringcontext)).ok() } pub unsafe fn Invalidate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szname: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), szname.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for ICreateTypeInfo2 { type Vtable = ICreateTypeInfo2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0002040e_0000_0000_c000_000000000046); } impl ::core::convert::From<ICreateTypeInfo2> for ::windows::core::IUnknown { fn from(value: ICreateTypeInfo2) -> Self { value.0 } } impl ::core::convert::From<&ICreateTypeInfo2> for ::windows::core::IUnknown { fn from(value: &ICreateTypeInfo2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ICreateTypeInfo2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ICreateTypeInfo2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<ICreateTypeInfo2> for ICreateTypeInfo { fn from(value: ICreateTypeInfo2) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&ICreateTypeInfo2> for ICreateTypeInfo { fn from(value: &ICreateTypeInfo2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, ICreateTypeInfo> for ICreateTypeInfo2 { fn into_param(self) -> ::windows::core::Param<'a, ICreateTypeInfo> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, ICreateTypeInfo> for &ICreateTypeInfo2 { fn into_param(self) -> ::windows::core::Param<'a, ICreateTypeInfo> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct ICreateTypeInfo2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, guid: *const ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, utypeflags: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstrdoc: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwhelpcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptinfo: ::windows::core::RawPtr, phreftype: *const u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, pfuncdesc: *const super::Com::FUNCDESC) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, hreftype: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, impltypeflags: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cbalignment: u16) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstrschema: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, pvardesc: *const super::Com::VARDESC) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptdescalias: *const super::Com::TYPEDESC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szdllname: super::super::Foundation::PWSTR, szprocname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szdocstring: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, szdocstring: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dwhelpcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dwhelpcontext: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, bstrmops: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pidldesc: *const super::Com::IDLDESC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, memid: i32, invkind: super::Com::INVOKEKIND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, memid: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, guid: *const ::windows::core::GUID, pvarval: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, guid: *const ::windows::core::GUID, pvarval: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indexfunc: u32, indexparam: u32, guid: *const ::windows::core::GUID, pvarval: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, guid: *const ::windows::core::GUID, pvarval: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, guid: *const ::windows::core::GUID, pvarval: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwhelpstringcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dwhelpstringcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dwhelpstringcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ICreateTypeLib(pub ::windows::core::IUnknown); impl ICreateTypeLib { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn CreateTypeInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szname: Param0, tkind: super::Com::TYPEKIND) -> ::windows::core::Result<ICreateTypeInfo> { let mut result__: <ICreateTypeInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), szname.into_param().abi(), ::core::mem::transmute(tkind), &mut result__).from_abi::<ICreateTypeInfo>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szname: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), szname.into_param().abi()).ok() } pub unsafe fn SetVersion(&self, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wmajorvernum), ::core::mem::transmute(wminorvernum)).ok() } pub unsafe fn SetGuid(&self, guid: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(guid)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetDocString<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szdoc: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), szdoc.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetHelpFileName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szhelpfilename: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), szhelpfilename.into_param().abi()).ok() } pub unsafe fn SetHelpContext(&self, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwhelpcontext)).ok() } pub unsafe fn SetLcid(&self, lcid: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(lcid)).ok() } pub unsafe fn SetLibFlags(&self, ulibflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(ulibflags)).ok() } pub unsafe fn SaveAllChanges(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for ICreateTypeLib { type Vtable = ICreateTypeLib_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00020406_0000_0000_c000_000000000046); } impl ::core::convert::From<ICreateTypeLib> for ::windows::core::IUnknown { fn from(value: ICreateTypeLib) -> Self { value.0 } } impl ::core::convert::From<&ICreateTypeLib> for ::windows::core::IUnknown { fn from(value: &ICreateTypeLib) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ICreateTypeLib { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ICreateTypeLib { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ICreateTypeLib_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szname: super::super::Foundation::PWSTR, tkind: super::Com::TYPEKIND, ppctinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, guid: *const ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szdoc: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szhelpfilename: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwhelpcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lcid: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ulibflags: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ICreateTypeLib2(pub ::windows::core::IUnknown); impl ICreateTypeLib2 { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn CreateTypeInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szname: Param0, tkind: super::Com::TYPEKIND) -> ::windows::core::Result<ICreateTypeInfo> { let mut result__: <ICreateTypeInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), szname.into_param().abi(), ::core::mem::transmute(tkind), &mut result__).from_abi::<ICreateTypeInfo>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szname: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), szname.into_param().abi()).ok() } pub unsafe fn SetVersion(&self, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wmajorvernum), ::core::mem::transmute(wminorvernum)).ok() } pub unsafe fn SetGuid(&self, guid: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(guid)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetDocString<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szdoc: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), szdoc.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetHelpFileName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szhelpfilename: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), szhelpfilename.into_param().abi()).ok() } pub unsafe fn SetHelpContext(&self, dwhelpcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwhelpcontext)).ok() } pub unsafe fn SetLcid(&self, lcid: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(lcid)).ok() } pub unsafe fn SetLibFlags(&self, ulibflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(ulibflags)).ok() } pub unsafe fn SaveAllChanges(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DeleteTypeInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szname: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), szname.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SetCustData(&self, guid: *const ::windows::core::GUID, pvarval: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(guid), ::core::mem::transmute(pvarval)).ok() } pub unsafe fn SetHelpStringContext(&self, dwhelpstringcontext: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwhelpstringcontext)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetHelpStringDll<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szfilename: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), szfilename.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for ICreateTypeLib2 { type Vtable = ICreateTypeLib2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0002040f_0000_0000_c000_000000000046); } impl ::core::convert::From<ICreateTypeLib2> for ::windows::core::IUnknown { fn from(value: ICreateTypeLib2) -> Self { value.0 } } impl ::core::convert::From<&ICreateTypeLib2> for ::windows::core::IUnknown { fn from(value: &ICreateTypeLib2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ICreateTypeLib2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ICreateTypeLib2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<ICreateTypeLib2> for ICreateTypeLib { fn from(value: ICreateTypeLib2) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&ICreateTypeLib2> for ICreateTypeLib { fn from(value: &ICreateTypeLib2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, ICreateTypeLib> for ICreateTypeLib2 { fn into_param(self) -> ::windows::core::Param<'a, ICreateTypeLib> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, ICreateTypeLib> for &ICreateTypeLib2 { fn into_param(self) -> ::windows::core::Param<'a, ICreateTypeLib> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct ICreateTypeLib2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szname: super::super::Foundation::PWSTR, tkind: super::Com::TYPEKIND, ppctinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wmajorvernum: u16, wminorvernum: u16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, guid: *const ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szdoc: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szhelpfilename: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwhelpcontext: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lcid: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ulibflags: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, guid: *const ::windows::core::GUID, pvarval: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwhelpstringcontext: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szfilename: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); pub const IDC_BZ_ICON: u32 = 601u32; pub const IDC_BZ_MESSAGE1: u32 = 602u32; pub const IDC_BZ_RETRY: u32 = 600u32; pub const IDC_BZ_SWITCHTO: u32 = 604u32; pub const IDC_CI_BROWSE: u32 = 130u32; pub const IDC_CI_CURRENT: u32 = 121u32; pub const IDC_CI_CURRENTICON: u32 = 122u32; pub const IDC_CI_DEFAULT: u32 = 123u32; pub const IDC_CI_DEFAULTICON: u32 = 124u32; pub const IDC_CI_FROMFILE: u32 = 125u32; pub const IDC_CI_FROMFILEEDIT: u32 = 126u32; pub const IDC_CI_GROUP: u32 = 120u32; pub const IDC_CI_ICONDISPLAY: u32 = 131u32; pub const IDC_CI_ICONLIST: u32 = 127u32; pub const IDC_CI_LABEL: u32 = 128u32; pub const IDC_CI_LABELEDIT: u32 = 129u32; pub const IDC_CV_ACTIVATEAS: u32 = 156u32; pub const IDC_CV_ACTIVATELIST: u32 = 154u32; pub const IDC_CV_CHANGEICON: u32 = 153u32; pub const IDC_CV_CONVERTLIST: u32 = 158u32; pub const IDC_CV_CONVERTTO: u32 = 155u32; pub const IDC_CV_DISPLAYASICON: u32 = 152u32; pub const IDC_CV_ICONDISPLAY: u32 = 165u32; pub const IDC_CV_OBJECTTYPE: u32 = 150u32; pub const IDC_CV_RESULTTEXT: u32 = 157u32; pub const IDC_EL_AUTOMATIC: u32 = 202u32; pub const IDC_EL_CANCELLINK: u32 = 209u32; pub const IDC_EL_CHANGESOURCE: u32 = 201u32; pub const IDC_EL_COL1: u32 = 220u32; pub const IDC_EL_COL2: u32 = 221u32; pub const IDC_EL_COL3: u32 = 222u32; pub const IDC_EL_LINKSLISTBOX: u32 = 206u32; pub const IDC_EL_LINKSOURCE: u32 = 216u32; pub const IDC_EL_LINKTYPE: u32 = 217u32; pub const IDC_EL_MANUAL: u32 = 212u32; pub const IDC_EL_OPENSOURCE: u32 = 211u32; pub const IDC_EL_UPDATENOW: u32 = 210u32; pub const IDC_GP_CONVERT: u32 = 1013u32; pub const IDC_GP_OBJECTICON: u32 = 1014u32; pub const IDC_GP_OBJECTLOCATION: u32 = 1022u32; pub const IDC_GP_OBJECTNAME: u32 = 1009u32; pub const IDC_GP_OBJECTSIZE: u32 = 1011u32; pub const IDC_GP_OBJECTTYPE: u32 = 1010u32; pub const IDC_IO_ADDCONTROL: u32 = 2115u32; pub const IDC_IO_CHANGEICON: u32 = 2105u32; pub const IDC_IO_CONTROLTYPELIST: u32 = 2116u32; pub const IDC_IO_CREATEFROMFILE: u32 = 2101u32; pub const IDC_IO_CREATENEW: u32 = 2100u32; pub const IDC_IO_DISPLAYASICON: u32 = 2104u32; pub const IDC_IO_FILE: u32 = 2106u32; pub const IDC_IO_FILEDISPLAY: u32 = 2107u32; pub const IDC_IO_FILETEXT: u32 = 2112u32; pub const IDC_IO_FILETYPE: u32 = 2113u32; pub const IDC_IO_ICONDISPLAY: u32 = 2110u32; pub const IDC_IO_INSERTCONTROL: u32 = 2114u32; pub const IDC_IO_LINKFILE: u32 = 2102u32; pub const IDC_IO_OBJECTTYPELIST: u32 = 2103u32; pub const IDC_IO_OBJECTTYPETEXT: u32 = 2111u32; pub const IDC_IO_RESULTIMAGE: u32 = 2108u32; pub const IDC_IO_RESULTTEXT: u32 = 2109u32; pub const IDC_LP_AUTOMATIC: u32 = 1016u32; pub const IDC_LP_BREAKLINK: u32 = 1008u32; pub const IDC_LP_CHANGESOURCE: u32 = 1015u32; pub const IDC_LP_DATE: u32 = 1018u32; pub const IDC_LP_LINKSOURCE: u32 = 1012u32; pub const IDC_LP_MANUAL: u32 = 1017u32; pub const IDC_LP_OPENSOURCE: u32 = 1006u32; pub const IDC_LP_TIME: u32 = 1019u32; pub const IDC_LP_UPDATENOW: u32 = 1007u32; pub const IDC_OLEUIHELP: u32 = 99u32; pub const IDC_PS_CHANGEICON: u32 = 508u32; pub const IDC_PS_DISPLAYASICON: u32 = 506u32; pub const IDC_PS_DISPLAYLIST: u32 = 505u32; pub const IDC_PS_ICONDISPLAY: u32 = 507u32; pub const IDC_PS_PASTE: u32 = 500u32; pub const IDC_PS_PASTELINK: u32 = 501u32; pub const IDC_PS_PASTELINKLIST: u32 = 504u32; pub const IDC_PS_PASTELIST: u32 = 503u32; pub const IDC_PS_RESULTIMAGE: u32 = 509u32; pub const IDC_PS_RESULTTEXT: u32 = 510u32; pub const IDC_PS_SOURCETEXT: u32 = 502u32; pub const IDC_PU_CONVERT: u32 = 902u32; pub const IDC_PU_ICON: u32 = 908u32; pub const IDC_PU_LINKS: u32 = 900u32; pub const IDC_PU_TEXT: u32 = 901u32; pub const IDC_UL_METER: u32 = 1029u32; pub const IDC_UL_PERCENT: u32 = 1031u32; pub const IDC_UL_PROGRESS: u32 = 1032u32; pub const IDC_UL_STOP: u32 = 1030u32; pub const IDC_VP_ASICON: u32 = 1003u32; pub const IDC_VP_CHANGEICON: u32 = 1001u32; pub const IDC_VP_EDITABLE: u32 = 1002u32; pub const IDC_VP_ICONDISPLAY: u32 = 1021u32; pub const IDC_VP_PERCENT: u32 = 1000u32; pub const IDC_VP_RELATIVE: u32 = 1005u32; pub const IDC_VP_RESULTIMAGE: u32 = 1033u32; pub const IDC_VP_SCALETXT: u32 = 1034u32; pub const IDC_VP_SPIN: u32 = 1006u32; pub const IDD_BUSY: u32 = 1006u32; pub const IDD_CANNOTUPDATELINK: u32 = 1008u32; pub const IDD_CHANGEICON: u32 = 1001u32; pub const IDD_CHANGEICONBROWSE: u32 = 1011u32; pub const IDD_CHANGESOURCE: u32 = 1009u32; pub const IDD_CHANGESOURCE4: u32 = 1013u32; pub const IDD_CONVERT: u32 = 1002u32; pub const IDD_CONVERT4: u32 = 1103u32; pub const IDD_CONVERTONLY: u32 = 1012u32; pub const IDD_CONVERTONLY4: u32 = 1104u32; pub const IDD_EDITLINKS: u32 = 1004u32; pub const IDD_EDITLINKS4: u32 = 1105u32; pub const IDD_GNRLPROPS: u32 = 1100u32; pub const IDD_GNRLPROPS4: u32 = 1106u32; pub const IDD_INSERTFILEBROWSE: u32 = 1010u32; pub const IDD_INSERTOBJECT: u32 = 1000u32; pub const IDD_LINKPROPS: u32 = 1102u32; pub const IDD_LINKPROPS4: u32 = 1107u32; pub const IDD_LINKSOURCEUNAVAILABLE: u32 = 1020u32; pub const IDD_LINKTYPECHANGED: u32 = 1022u32; pub const IDD_LINKTYPECHANGEDA: u32 = 1026u32; pub const IDD_LINKTYPECHANGEDW: u32 = 1022u32; pub const IDD_OUTOFMEMORY: u32 = 1024u32; pub const IDD_PASTESPECIAL: u32 = 1003u32; pub const IDD_PASTESPECIAL4: u32 = 1108u32; pub const IDD_SERVERNOTFOUND: u32 = 1023u32; pub const IDD_SERVERNOTREG: u32 = 1021u32; pub const IDD_SERVERNOTREGA: u32 = 1025u32; pub const IDD_SERVERNOTREGW: u32 = 1021u32; pub const IDD_UPDATELINKS: u32 = 1007u32; pub const IDD_VIEWPROPS: u32 = 1101u32; pub const IDLFLAG_FIN: u32 = 1u32; pub const IDLFLAG_FLCID: u32 = 4u32; pub const IDLFLAG_FOUT: u32 = 2u32; pub const IDLFLAG_FRETVAL: u32 = 8u32; pub const IDLFLAG_NONE: u32 = 0u32; pub const ID_BROWSE_ADDCONTROL: u32 = 3u32; pub const ID_BROWSE_CHANGEICON: u32 = 1u32; pub const ID_BROWSE_CHANGESOURCE: u32 = 4u32; pub const ID_BROWSE_INSERTFILE: u32 = 2u32; pub const ID_DEFAULTINST: i32 = -2i32; #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IDispError(pub ::windows::core::IUnknown); impl IDispError { pub unsafe fn QueryErrorInfo<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::GUID>>(&self, guiderrortype: Param0) -> ::windows::core::Result<IDispError> { let mut result__: <IDispError as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), guiderrortype.into_param().abi(), &mut result__).from_abi::<IDispError>(result__) } pub unsafe fn GetNext(&self) -> ::windows::core::Result<IDispError> { let mut result__: <IDispError as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDispError>(result__) } pub unsafe fn GetHresult(&self) -> ::windows::core::Result<::windows::core::HRESULT> { let mut result__: <::windows::core::HRESULT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::HRESULT>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetSource(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetHelpInfo(&self, pbstrfilename: *mut super::super::Foundation::BSTR, pdwcontext: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(pbstrfilename), ::core::mem::transmute(pdwcontext)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetDescription(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } } unsafe impl ::windows::core::Interface for IDispError { type Vtable = IDispError_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa6ef9861_c720_11d0_9337_00a0c90dcaa9); } impl ::core::convert::From<IDispError> for ::windows::core::IUnknown { fn from(value: IDispError) -> Self { value.0 } } impl ::core::convert::From<&IDispError> for ::windows::core::IUnknown { fn from(value: &IDispError) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDispError { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDispError { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IDispError_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, guiderrortype: ::windows::core::GUID, ppde: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppde: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phr: *mut ::windows::core::HRESULT) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstrsource: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstrfilename: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, pdwcontext: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstrdescription: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IDispatchEx(pub ::windows::core::IUnknown); impl IDispatchEx { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetDispID<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(&self, bstrname: Param0, grfdex: u32) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), bstrname.into_param().abi(), ::core::mem::transmute(grfdex), &mut result__).from_abi::<i32>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn InvokeEx<'a, Param6: ::windows::core::IntoParam<'a, super::Com::IServiceProvider>>(&self, id: i32, lcid: u32, wflags: u16, pdp: *const super::Com::DISPPARAMS, pvarres: *mut super::Com::VARIANT, pei: *mut super::Com::EXCEPINFO, pspcaller: Param6) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(id), ::core::mem::transmute(lcid), ::core::mem::transmute(wflags), ::core::mem::transmute(pdp), ::core::mem::transmute(pvarres), ::core::mem::transmute(pei), pspcaller.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DeleteMemberByName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(&self, bstrname: Param0, grfdex: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), bstrname.into_param().abi(), ::core::mem::transmute(grfdex)).ok() } pub unsafe fn DeleteMemberByDispID(&self, id: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(id)).ok() } pub unsafe fn GetMemberProperties(&self, id: i32, grfdexfetch: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(id), ::core::mem::transmute(grfdexfetch), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetMemberName(&self, id: i32) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(id), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } pub unsafe fn GetNextDispID(&self, grfdex: u32, id: i32) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(grfdex), ::core::mem::transmute(id), &mut result__).from_abi::<i32>(result__) } pub unsafe fn GetNameSpaceParent(&self) -> ::windows::core::Result<::windows::core::IUnknown> { let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__) } } unsafe impl ::windows::core::Interface for IDispatchEx { type Vtable = IDispatchEx_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa6ef9860_c720_11d0_9337_00a0c90dcaa9); } impl ::core::convert::From<IDispatchEx> for ::windows::core::IUnknown { fn from(value: IDispatchEx) -> Self { value.0 } } impl ::core::convert::From<&IDispatchEx> for ::windows::core::IUnknown { fn from(value: &IDispatchEx) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDispatchEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDispatchEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IDispatchEx> for super::Com::IDispatch { fn from(value: IDispatchEx) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IDispatchEx> for super::Com::IDispatch { fn from(value: &IDispatchEx) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for IDispatchEx { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for &IDispatchEx { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IDispatchEx_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pctinfo: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, itinfo: u32, lcid: u32, pptinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32, lcid: u32, rgdispid: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispidmember: i32, riid: *const ::windows::core::GUID, lcid: u32, wflags: u16, pdispparams: *const super::Com::DISPPARAMS, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pexcepinfo: *mut ::core::mem::ManuallyDrop<super::Com::EXCEPINFO>, puargerr: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bstrname: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, grfdex: u32, pid: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, id: i32, lcid: u32, wflags: u16, pdp: *const super::Com::DISPPARAMS, pvarres: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pei: *mut ::core::mem::ManuallyDrop<super::Com::EXCEPINFO>, pspcaller: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bstrname: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, grfdex: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, id: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, id: i32, grfdexfetch: u32, pgrfdex: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, id: i32, pbstrname: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, grfdex: u32, id: i32, pid: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppunk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IDropSource(pub ::windows::core::IUnknown); impl IDropSource { #[cfg(feature = "Win32_Foundation")] pub unsafe fn QueryContinueDrag<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fescapepressed: Param0, grfkeystate: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), fescapepressed.into_param().abi(), ::core::mem::transmute(grfkeystate)).ok() } pub unsafe fn GiveFeedback(&self, dweffect: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dweffect)).ok() } } unsafe impl ::windows::core::Interface for IDropSource { type Vtable = IDropSource_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000121_0000_0000_c000_000000000046); } impl ::core::convert::From<IDropSource> for ::windows::core::IUnknown { fn from(value: IDropSource) -> Self { value.0 } } impl ::core::convert::From<&IDropSource> for ::windows::core::IUnknown { fn from(value: &IDropSource) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDropSource { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDropSource { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IDropSource_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fescapepressed: super::super::Foundation::BOOL, grfkeystate: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dweffect: u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IDropSourceNotify(pub ::windows::core::IUnknown); impl IDropSourceNotify { #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragEnterTarget<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(&self, hwndtarget: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), hwndtarget.into_param().abi()).ok() } pub unsafe fn DragLeaveTarget(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IDropSourceNotify { type Vtable = IDropSourceNotify_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000012b_0000_0000_c000_000000000046); } impl ::core::convert::From<IDropSourceNotify> for ::windows::core::IUnknown { fn from(value: IDropSourceNotify) -> Self { value.0 } } impl ::core::convert::From<&IDropSourceNotify> for ::windows::core::IUnknown { fn from(value: &IDropSourceNotify) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDropSourceNotify { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDropSourceNotify { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IDropSourceNotify_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hwndtarget: super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IDropTarget(pub ::windows::core::IUnknown); impl IDropTarget { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn DragEnter<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::POINTL>>(&self, pdataobj: Param0, grfkeystate: u32, pt: Param2, pdweffect: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pdataobj.into_param().abi(), ::core::mem::transmute(grfkeystate), pt.into_param().abi(), ::core::mem::transmute(pdweffect)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragOver<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::POINTL>>(&self, grfkeystate: u32, pt: Param1, pdweffect: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(grfkeystate), pt.into_param().abi(), ::core::mem::transmute(pdweffect)).ok() } pub unsafe fn DragLeave(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn Drop<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::POINTL>>(&self, pdataobj: Param0, grfkeystate: u32, pt: Param2, pdweffect: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), pdataobj.into_param().abi(), ::core::mem::transmute(grfkeystate), pt.into_param().abi(), ::core::mem::transmute(pdweffect)).ok() } } unsafe impl ::windows::core::Interface for IDropTarget { type Vtable = IDropTarget_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000122_0000_0000_c000_000000000046); } impl ::core::convert::From<IDropTarget> for ::windows::core::IUnknown { fn from(value: IDropTarget) -> Self { value.0 } } impl ::core::convert::From<&IDropTarget> for ::windows::core::IUnknown { fn from(value: &IDropTarget) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDropTarget { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDropTarget { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IDropTarget_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdataobj: ::windows::core::RawPtr, grfkeystate: u32, pt: super::super::Foundation::POINTL, pdweffect: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, grfkeystate: u32, pt: super::super::Foundation::POINTL, pdweffect: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdataobj: ::windows::core::RawPtr, grfkeystate: u32, pt: super::super::Foundation::POINTL, pdweffect: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IEnterpriseDropTarget(pub ::windows::core::IUnknown); impl IEnterpriseDropTarget { #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetDropSourceEnterpriseId<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, identity: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), identity.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn IsEvaluatingEdpPolicy(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } } unsafe impl ::windows::core::Interface for IEnterpriseDropTarget { type Vtable = IEnterpriseDropTarget_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x390e3878_fd55_4e18_819d_4682081c0cfd); } impl ::core::convert::From<IEnterpriseDropTarget> for ::windows::core::IUnknown { fn from(value: IEnterpriseDropTarget) -> Self { value.0 } } impl ::core::convert::From<&IEnterpriseDropTarget> for ::windows::core::IUnknown { fn from(value: &IEnterpriseDropTarget) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IEnterpriseDropTarget { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IEnterpriseDropTarget { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IEnterpriseDropTarget_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, identity: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IEnumOLEVERB(pub ::windows::core::IUnknown); impl IEnumOLEVERB { #[cfg(feature = "Win32_Foundation")] pub unsafe fn Next(&self, celt: u32, rgelt: *mut OLEVERB, pceltfetched: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(celt), ::core::mem::transmute(rgelt), ::core::mem::transmute(pceltfetched)).ok() } pub unsafe fn Skip(&self, celt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(celt)).ok() } pub unsafe fn Reset(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn Clone(&self) -> ::windows::core::Result<IEnumOLEVERB> { let mut result__: <IEnumOLEVERB as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IEnumOLEVERB>(result__) } } unsafe impl ::windows::core::Interface for IEnumOLEVERB { type Vtable = IEnumOLEVERB_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000104_0000_0000_c000_000000000046); } impl ::core::convert::From<IEnumOLEVERB> for ::windows::core::IUnknown { fn from(value: IEnumOLEVERB) -> Self { value.0 } } impl ::core::convert::From<&IEnumOLEVERB> for ::windows::core::IUnknown { fn from(value: &IEnumOLEVERB) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IEnumOLEVERB { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IEnumOLEVERB { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IEnumOLEVERB_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, celt: u32, rgelt: *mut OLEVERB, pceltfetched: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, celt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IEnumOleDocumentViews(pub ::windows::core::IUnknown); impl IEnumOleDocumentViews { pub unsafe fn Next(&self, cviews: u32, rgpview: *mut ::core::option::Option<IOleDocumentView>, pcfetched: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(cviews), ::core::mem::transmute(rgpview), ::core::mem::transmute(pcfetched)).ok() } pub unsafe fn Skip(&self, cviews: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(cviews)).ok() } pub unsafe fn Reset(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn Clone(&self) -> ::windows::core::Result<IEnumOleDocumentViews> { let mut result__: <IEnumOleDocumentViews as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IEnumOleDocumentViews>(result__) } } unsafe impl ::windows::core::Interface for IEnumOleDocumentViews { type Vtable = IEnumOleDocumentViews_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb722bcc8_4e68_101b_a2bc_00aa00404770); } impl ::core::convert::From<IEnumOleDocumentViews> for ::windows::core::IUnknown { fn from(value: IEnumOleDocumentViews) -> Self { value.0 } } impl ::core::convert::From<&IEnumOleDocumentViews> for ::windows::core::IUnknown { fn from(value: &IEnumOleDocumentViews) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IEnumOleDocumentViews { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IEnumOleDocumentViews { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IEnumOleDocumentViews_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cviews: u32, rgpview: *mut ::windows::core::RawPtr, pcfetched: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cviews: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IEnumOleUndoUnits(pub ::windows::core::IUnknown); impl IEnumOleUndoUnits { pub unsafe fn Next(&self, celt: u32, rgelt: *mut ::core::option::Option<IOleUndoUnit>, pceltfetched: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(celt), ::core::mem::transmute(rgelt), ::core::mem::transmute(pceltfetched)).ok() } pub unsafe fn Skip(&self, celt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(celt)).ok() } pub unsafe fn Reset(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn Clone(&self) -> ::windows::core::Result<IEnumOleUndoUnits> { let mut result__: <IEnumOleUndoUnits as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IEnumOleUndoUnits>(result__) } } unsafe impl ::windows::core::Interface for IEnumOleUndoUnits { type Vtable = IEnumOleUndoUnits_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb3e7c340_ef97_11ce_9bc9_00aa00608e01); } impl ::core::convert::From<IEnumOleUndoUnits> for ::windows::core::IUnknown { fn from(value: IEnumOleUndoUnits) -> Self { value.0 } } impl ::core::convert::From<&IEnumOleUndoUnits> for ::windows::core::IUnknown { fn from(value: &IEnumOleUndoUnits) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IEnumOleUndoUnits { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IEnumOleUndoUnits { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IEnumOleUndoUnits_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, celt: u32, rgelt: *mut ::windows::core::RawPtr, pceltfetched: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, celt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IEnumVARIANT(pub ::windows::core::IUnknown); impl IEnumVARIANT { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn Next(&self, celt: u32, rgvar: *mut super::Com::VARIANT, pceltfetched: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(celt), ::core::mem::transmute(rgvar), ::core::mem::transmute(pceltfetched)).ok() } pub unsafe fn Skip(&self, celt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(celt)).ok() } pub unsafe fn Reset(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn Clone(&self) -> ::windows::core::Result<IEnumVARIANT> { let mut result__: <IEnumVARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IEnumVARIANT>(result__) } } unsafe impl ::windows::core::Interface for IEnumVARIANT { type Vtable = IEnumVARIANT_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00020404_0000_0000_c000_000000000046); } impl ::core::convert::From<IEnumVARIANT> for ::windows::core::IUnknown { fn from(value: IEnumVARIANT) -> Self { value.0 } } impl ::core::convert::From<&IEnumVARIANT> for ::windows::core::IUnknown { fn from(value: &IEnumVARIANT) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IEnumVARIANT { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IEnumVARIANT { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IEnumVARIANT_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, celt: u32, rgvar: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pceltfetched: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, celt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IFont(pub ::windows::core::IUnknown); impl IFont { #[cfg(feature = "Win32_Foundation")] pub unsafe fn Name(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(&self, name: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), name.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn Size(&self) -> ::windows::core::Result<super::Com::CY> { let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetSize<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(&self, size: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), size.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Bold(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetBold<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, bold: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), bold.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Italic(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetItalic<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, italic: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), italic.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Underline(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetUnderline<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, underline: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), underline.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Strikethrough(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetStrikethrough<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, strikethrough: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), strikethrough.into_param().abi()).ok() } pub unsafe fn Weight(&self) -> ::windows::core::Result<i16> { let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i16>(result__) } pub unsafe fn SetWeight(&self, weight: i16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(weight)).ok() } pub unsafe fn Charset(&self) -> ::windows::core::Result<i16> { let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i16>(result__) } pub unsafe fn SetCharset(&self, charset: i16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(charset)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn hFont(&self) -> ::windows::core::Result<super::super::Graphics::Gdi::HFONT> { let mut result__: <super::super::Graphics::Gdi::HFONT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Graphics::Gdi::HFONT>(result__) } pub unsafe fn Clone(&self) -> ::windows::core::Result<IFont> { let mut result__: <IFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IFont>(result__) } pub unsafe fn IsEqual<'a, Param0: ::windows::core::IntoParam<'a, IFont>>(&self, pfontother: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), pfontother.into_param().abi()).ok() } pub unsafe fn SetRatio(&self, cylogical: i32, cyhimetric: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(cylogical), ::core::mem::transmute(cyhimetric)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn QueryTextMetrics(&self) -> ::windows::core::Result<super::super::Graphics::Gdi::TEXTMETRICW> { let mut result__: <super::super::Graphics::Gdi::TEXTMETRICW as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Graphics::Gdi::TEXTMETRICW>(result__) } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn AddRefHfont<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HFONT>>(&self, hfont: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), hfont.into_param().abi()).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn ReleaseHfont<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HFONT>>(&self, hfont: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), hfont.into_param().abi()).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn SetHdc<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, hdc: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), hdc.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IFont { type Vtable = IFont_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xbef6e002_a874_101a_8bba_00aa00300cab); } impl ::core::convert::From<IFont> for ::windows::core::IUnknown { fn from(value: IFont) -> Self { value.0 } } impl ::core::convert::From<&IFont> for ::windows::core::IUnknown { fn from(value: &IFont) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IFont { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IFont { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IFont_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pname: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, psize: *mut super::Com::CY) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, size: super::Com::CY) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbold: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bold: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pitalic: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, italic: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punderline: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, underline: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstrikethrough: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strikethrough: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pweight: *mut i16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, weight: i16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pcharset: *mut i16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, charset: i16) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phfont: *mut super::super::Graphics::Gdi::HFONT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppfont: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pfontother: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cylogical: i32, cyhimetric: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptm: *mut super::super::Graphics::Gdi::TEXTMETRICW) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hfont: super::super::Graphics::Gdi::HFONT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hfont: super::super::Graphics::Gdi::HFONT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::super::Graphics::Gdi::HDC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IFontDisp(pub ::windows::core::IUnknown); impl IFontDisp {} unsafe impl ::windows::core::Interface for IFontDisp { type Vtable = IFontDisp_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xbef6e003_a874_101a_8bba_00aa00300cab); } impl ::core::convert::From<IFontDisp> for ::windows::core::IUnknown { fn from(value: IFontDisp) -> Self { value.0 } } impl ::core::convert::From<&IFontDisp> for ::windows::core::IUnknown { fn from(value: &IFontDisp) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IFontDisp { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IFontDisp { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IFontDisp> for super::Com::IDispatch { fn from(value: IFontDisp) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IFontDisp> for super::Com::IDispatch { fn from(value: &IFontDisp) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for IFontDisp { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for &IFontDisp { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IFontDisp_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pctinfo: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, itinfo: u32, lcid: u32, pptinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32, lcid: u32, rgdispid: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispidmember: i32, riid: *const ::windows::core::GUID, lcid: u32, wflags: u16, pdispparams: *const super::Com::DISPPARAMS, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pexcepinfo: *mut ::core::mem::ManuallyDrop<super::Com::EXCEPINFO>, puargerr: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IFontEventsDisp(pub ::windows::core::IUnknown); impl IFontEventsDisp {} unsafe impl ::windows::core::Interface for IFontEventsDisp { type Vtable = IFontEventsDisp_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4ef6100a_af88_11d0_9846_00c04fc29993); } impl ::core::convert::From<IFontEventsDisp> for ::windows::core::IUnknown { fn from(value: IFontEventsDisp) -> Self { value.0 } } impl ::core::convert::From<&IFontEventsDisp> for ::windows::core::IUnknown { fn from(value: &IFontEventsDisp) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IFontEventsDisp { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IFontEventsDisp { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IFontEventsDisp> for super::Com::IDispatch { fn from(value: IFontEventsDisp) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IFontEventsDisp> for super::Com::IDispatch { fn from(value: &IFontEventsDisp) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for IFontEventsDisp { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for &IFontEventsDisp { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IFontEventsDisp_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pctinfo: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, itinfo: u32, lcid: u32, pptinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32, lcid: u32, rgdispid: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispidmember: i32, riid: *const ::windows::core::GUID, lcid: u32, wflags: u16, pdispparams: *const super::Com::DISPPARAMS, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pexcepinfo: *mut ::core::mem::ManuallyDrop<super::Com::EXCEPINFO>, puargerr: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct IGNOREMIME(pub i32); pub const IGNOREMIME_PROMPT: IGNOREMIME = IGNOREMIME(1i32); pub const IGNOREMIME_TEXT: IGNOREMIME = IGNOREMIME(2i32); impl ::core::convert::From<i32> for IGNOREMIME { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for IGNOREMIME { type Abi = Self; } #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IGetOleObject(pub ::windows::core::IUnknown); impl IGetOleObject { pub unsafe fn GetOleObject(&self, riid: *const ::windows::core::GUID, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(riid), ::core::mem::transmute(ppvobj)).ok() } } unsafe impl ::windows::core::Interface for IGetOleObject { type Vtable = IGetOleObject_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x8a701da0_4feb_101b_a82e_08002b2b2337); } impl ::core::convert::From<IGetOleObject> for ::windows::core::IUnknown { fn from(value: IGetOleObject) -> Self { value.0 } } impl ::core::convert::From<&IGetOleObject> for ::windows::core::IUnknown { fn from(value: &IGetOleObject) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IGetOleObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IGetOleObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IGetOleObject_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IGetVBAObject(pub ::windows::core::IUnknown); impl IGetVBAObject { pub unsafe fn GetObject(&self, riid: *const ::windows::core::GUID, ppvobj: *mut *mut ::core::ffi::c_void, dwreserved: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(riid), ::core::mem::transmute(ppvobj), ::core::mem::transmute(dwreserved)).ok() } } unsafe impl ::windows::core::Interface for IGetVBAObject { type Vtable = IGetVBAObject_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x91733a60_3f4c_101b_a3f6_00aa0034e4e9); } impl ::core::convert::From<IGetVBAObject> for ::windows::core::IUnknown { fn from(value: IGetVBAObject) -> Self { value.0 } } impl ::core::convert::From<&IGetVBAObject> for ::windows::core::IUnknown { fn from(value: &IGetVBAObject) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IGetVBAObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IGetVBAObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IGetVBAObject_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppvobj: *mut *mut ::core::ffi::c_void, dwreserved: u32) -> ::windows::core::HRESULT, ); pub const IMPLTYPEFLAG_FDEFAULT: u32 = 1u32; pub const IMPLTYPEFLAG_FDEFAULTVTABLE: u32 = 8u32; pub const IMPLTYPEFLAG_FRESTRICTED: u32 = 4u32; pub const IMPLTYPEFLAG_FSOURCE: u32 = 2u32; pub const INSTALL_SCOPE_INVALID: u32 = 0u32; pub const INSTALL_SCOPE_MACHINE: u32 = 1u32; pub const INSTALL_SCOPE_USER: u32 = 2u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct INTERFACEDATA { pub pmethdata: *mut METHODDATA, pub cMembers: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl INTERFACEDATA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for INTERFACEDATA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for INTERFACEDATA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("INTERFACEDATA").field("pmethdata", &self.pmethdata).field("cMembers", &self.cMembers).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for INTERFACEDATA { fn eq(&self, other: &Self) -> bool { self.pmethdata == other.pmethdata && self.cMembers == other.cMembers } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for INTERFACEDATA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for INTERFACEDATA { type Abi = Self; } pub const IOF_CHECKDISPLAYASICON: i32 = 16i32; pub const IOF_CHECKLINK: i32 = 8i32; pub const IOF_CREATEFILEOBJECT: i32 = 64i32; pub const IOF_CREATELINKOBJECT: i32 = 128i32; pub const IOF_CREATENEWOBJECT: i32 = 32i32; pub const IOF_DISABLEDISPLAYASICON: i32 = 1024i32; pub const IOF_DISABLELINK: i32 = 256i32; pub const IOF_HIDECHANGEICON: i32 = 2048i32; pub const IOF_SELECTCREATECONTROL: i32 = 8192i32; pub const IOF_SELECTCREATEFROMFILE: i32 = 4i32; pub const IOF_SELECTCREATENEW: i32 = 2i32; pub const IOF_SHOWHELP: i32 = 1i32; pub const IOF_SHOWINSERTCONTROL: i32 = 4096i32; pub const IOF_VERIFYSERVERSEXIST: i32 = 512i32; #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IObjectIdentity(pub ::windows::core::IUnknown); impl IObjectIdentity { pub unsafe fn IsEqualObject<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, punk: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), punk.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IObjectIdentity { type Vtable = IObjectIdentity_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xca04b7e6_0d21_11d1_8cc5_00c04fc2b085); } impl ::core::convert::From<IObjectIdentity> for ::windows::core::IUnknown { fn from(value: IObjectIdentity) -> Self { value.0 } } impl ::core::convert::From<&IObjectIdentity> for ::windows::core::IUnknown { fn from(value: &IObjectIdentity) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IObjectIdentity { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IObjectIdentity { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IObjectIdentity_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punk: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IObjectWithSite(pub ::windows::core::IUnknown); impl IObjectWithSite { pub unsafe fn SetSite<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, punksite: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), punksite.into_param().abi()).ok() } pub unsafe fn GetSite<T: ::windows::core::Interface>(&self) -> ::windows::core::Result<T> { let mut result__ = ::core::option::Option::None; (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &<T as ::windows::core::Interface>::IID, &mut result__ as *mut _ as *mut _).and_some(result__) } } unsafe impl ::windows::core::Interface for IObjectWithSite { type Vtable = IObjectWithSite_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfc4801a3_2ba9_11cf_a229_00aa003d7352); } impl ::core::convert::From<IObjectWithSite> for ::windows::core::IUnknown { fn from(value: IObjectWithSite) -> Self { value.0 } } impl ::core::convert::From<&IObjectWithSite> for ::windows::core::IUnknown { fn from(value: &IObjectWithSite) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IObjectWithSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IObjectWithSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IObjectWithSite_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punksite: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppvsite: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleAdviseHolder(pub ::windows::core::IUnknown); impl IOleAdviseHolder { #[cfg(feature = "Win32_System_Com")] pub unsafe fn Advise<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>>(&self, padvise: Param0) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), padvise.into_param().abi(), &mut result__).from_abi::<u32>(result__) } pub unsafe fn Unadvise(&self, dwconnection: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwconnection)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn EnumAdvise(&self) -> ::windows::core::Result<super::Com::IEnumSTATDATA> { let mut result__: <super::Com::IEnumSTATDATA as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::IEnumSTATDATA>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SendOnRename<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IMoniker>>(&self, pmk: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), pmk.into_param().abi()).ok() } pub unsafe fn SendOnSave(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn SendOnClose(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IOleAdviseHolder { type Vtable = IOleAdviseHolder_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000111_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleAdviseHolder> for ::windows::core::IUnknown { fn from(value: IOleAdviseHolder) -> Self { value.0 } } impl ::core::convert::From<&IOleAdviseHolder> for ::windows::core::IUnknown { fn from(value: &IOleAdviseHolder) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleAdviseHolder { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleAdviseHolder { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleAdviseHolder_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, padvise: ::windows::core::RawPtr, pdwconnection: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwconnection: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenumadvise: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmk: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleCache(pub ::windows::core::IUnknown); impl IOleCache { #[cfg(feature = "Win32_System_Com")] pub unsafe fn Cache(&self, pformatetc: *const super::Com::FORMATETC, advf: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pformatetc), ::core::mem::transmute(advf), &mut result__).from_abi::<u32>(result__) } pub unsafe fn Uncache(&self, dwconnection: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwconnection)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn EnumCache(&self) -> ::windows::core::Result<super::Com::IEnumSTATDATA> { let mut result__: <super::Com::IEnumSTATDATA as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::IEnumSTATDATA>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn InitCache<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(&self, pdataobject: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), pdataobject.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn SetData<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pformatetc: *const super::Com::FORMATETC, pmedium: *const super::Com::STGMEDIUM, frelease: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(pformatetc), ::core::mem::transmute(pmedium), frelease.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleCache { type Vtable = IOleCache_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000011e_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleCache> for ::windows::core::IUnknown { fn from(value: IOleCache) -> Self { value.0 } } impl ::core::convert::From<&IOleCache> for ::windows::core::IUnknown { fn from(value: &IOleCache) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleCache { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleCache { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleCache_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pformatetc: *const super::Com::FORMATETC, advf: u32, pdwconnection: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwconnection: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenumstatdata: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdataobject: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pformatetc: *const super::Com::FORMATETC, pmedium: *const ::core::mem::ManuallyDrop<super::Com::STGMEDIUM>, frelease: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleCache2(pub ::windows::core::IUnknown); impl IOleCache2 { #[cfg(feature = "Win32_System_Com")] pub unsafe fn Cache(&self, pformatetc: *const super::Com::FORMATETC, advf: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pformatetc), ::core::mem::transmute(advf), &mut result__).from_abi::<u32>(result__) } pub unsafe fn Uncache(&self, dwconnection: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwconnection)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn EnumCache(&self) -> ::windows::core::Result<super::Com::IEnumSTATDATA> { let mut result__: <super::Com::IEnumSTATDATA as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::IEnumSTATDATA>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn InitCache<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(&self, pdataobject: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), pdataobject.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn SetData<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pformatetc: *const super::Com::FORMATETC, pmedium: *const super::Com::STGMEDIUM, frelease: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(pformatetc), ::core::mem::transmute(pmedium), frelease.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn UpdateCache<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(&self, pdataobject: Param0, grfupdf: UPDFCACHE_FLAGS, preserved: *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), pdataobject.into_param().abi(), ::core::mem::transmute(grfupdf), ::core::mem::transmute(preserved)).ok() } pub unsafe fn DiscardCache(&self, dwdiscardoptions: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdiscardoptions)).ok() } } unsafe impl ::windows::core::Interface for IOleCache2 { type Vtable = IOleCache2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000128_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleCache2> for ::windows::core::IUnknown { fn from(value: IOleCache2) -> Self { value.0 } } impl ::core::convert::From<&IOleCache2> for ::windows::core::IUnknown { fn from(value: &IOleCache2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleCache2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleCache2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleCache2> for IOleCache { fn from(value: IOleCache2) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleCache2> for IOleCache { fn from(value: &IOleCache2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleCache> for IOleCache2 { fn into_param(self) -> ::windows::core::Param<'a, IOleCache> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleCache> for &IOleCache2 { fn into_param(self) -> ::windows::core::Param<'a, IOleCache> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleCache2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pformatetc: *const super::Com::FORMATETC, advf: u32, pdwconnection: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwconnection: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenumstatdata: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdataobject: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pformatetc: *const super::Com::FORMATETC, pmedium: *const ::core::mem::ManuallyDrop<super::Com::STGMEDIUM>, frelease: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage")))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdataobject: ::windows::core::RawPtr, grfupdf: UPDFCACHE_FLAGS, preserved: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdiscardoptions: u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleCacheControl(pub ::windows::core::IUnknown); impl IOleCacheControl { #[cfg(feature = "Win32_System_Com")] pub unsafe fn OnRun<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(&self, pdataobject: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pdataobject.into_param().abi()).ok() } pub unsafe fn OnStop(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IOleCacheControl { type Vtable = IOleCacheControl_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000129_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleCacheControl> for ::windows::core::IUnknown { fn from(value: IOleCacheControl) -> Self { value.0 } } impl ::core::convert::From<&IOleCacheControl> for ::windows::core::IUnknown { fn from(value: &IOleCacheControl) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleCacheControl { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleCacheControl { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleCacheControl_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdataobject: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleClientSite(pub ::windows::core::IUnknown); impl IOleClientSite { pub unsafe fn SaveObject(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetMoniker(&self, dwassign: u32, dwwhichmoniker: u32) -> ::windows::core::Result<super::Com::IMoniker> { let mut result__: <super::Com::IMoniker as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwassign), ::core::mem::transmute(dwwhichmoniker), &mut result__).from_abi::<super::Com::IMoniker>(result__) } pub unsafe fn GetContainer(&self) -> ::windows::core::Result<IOleContainer> { let mut result__: <IOleContainer as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IOleContainer>(result__) } pub unsafe fn ShowObject(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnShowWindow<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fshow: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), fshow.into_param().abi()).ok() } pub unsafe fn RequestNewObjectLayout(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IOleClientSite { type Vtable = IOleClientSite_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000118_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleClientSite> for ::windows::core::IUnknown { fn from(value: IOleClientSite) -> Self { value.0 } } impl ::core::convert::From<&IOleClientSite> for ::windows::core::IUnknown { fn from(value: &IOleClientSite) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleClientSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleClientSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleClientSite_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwassign: u32, dwwhichmoniker: u32, ppmk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppcontainer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fshow: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleCommandTarget(pub ::windows::core::IUnknown); impl IOleCommandTarget { pub unsafe fn QueryStatus(&self, pguidcmdgroup: *const ::windows::core::GUID, ccmds: u32, prgcmds: *mut OLECMD, pcmdtext: *mut OLECMDTEXT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pguidcmdgroup), ::core::mem::transmute(ccmds), ::core::mem::transmute(prgcmds), ::core::mem::transmute(pcmdtext)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn Exec(&self, pguidcmdgroup: *const ::windows::core::GUID, ncmdid: u32, ncmdexecopt: u32, pvain: *const super::Com::VARIANT, pvaout: *mut super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(pguidcmdgroup), ::core::mem::transmute(ncmdid), ::core::mem::transmute(ncmdexecopt), ::core::mem::transmute(pvain), ::core::mem::transmute(pvaout)).ok() } } unsafe impl ::windows::core::Interface for IOleCommandTarget { type Vtable = IOleCommandTarget_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb722bccb_4e68_101b_a2bc_00aa00404770); } impl ::core::convert::From<IOleCommandTarget> for ::windows::core::IUnknown { fn from(value: IOleCommandTarget) -> Self { value.0 } } impl ::core::convert::From<&IOleCommandTarget> for ::windows::core::IUnknown { fn from(value: &IOleCommandTarget) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleCommandTarget { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleCommandTarget { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleCommandTarget_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pguidcmdgroup: *const ::windows::core::GUID, ccmds: u32, prgcmds: *mut OLECMD, pcmdtext: *mut OLECMDTEXT) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pguidcmdgroup: *const ::windows::core::GUID, ncmdid: u32, ncmdexecopt: u32, pvain: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvaout: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleContainer(pub ::windows::core::IUnknown); impl IOleContainer { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn ParseDisplayName<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IBindCtx>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pbc: Param0, pszdisplayname: Param1, pcheaten: *mut u32, ppmkout: *mut ::core::option::Option<super::Com::IMoniker>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pbc.into_param().abi(), pszdisplayname.into_param().abi(), ::core::mem::transmute(pcheaten), ::core::mem::transmute(ppmkout)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn EnumObjects(&self, grfflags: u32) -> ::windows::core::Result<super::Com::IEnumUnknown> { let mut result__: <super::Com::IEnumUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(grfflags), &mut result__).from_abi::<super::Com::IEnumUnknown>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn LockContainer<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, flock: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), flock.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleContainer { type Vtable = IOleContainer_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000011b_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleContainer> for ::windows::core::IUnknown { fn from(value: IOleContainer) -> Self { value.0 } } impl ::core::convert::From<&IOleContainer> for ::windows::core::IUnknown { fn from(value: &IOleContainer) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleContainer { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleContainer { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleContainer> for IParseDisplayName { fn from(value: IOleContainer) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleContainer> for IParseDisplayName { fn from(value: &IOleContainer) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IParseDisplayName> for IOleContainer { fn into_param(self) -> ::windows::core::Param<'a, IParseDisplayName> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IParseDisplayName> for &IOleContainer { fn into_param(self) -> ::windows::core::Param<'a, IParseDisplayName> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleContainer_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbc: ::windows::core::RawPtr, pszdisplayname: super::super::Foundation::PWSTR, pcheaten: *mut u32, ppmkout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, grfflags: u32, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flock: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleControl(pub ::windows::core::IUnknown); impl IOleControl { #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn GetControlInfo(&self, pci: *mut CONTROLINFO) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pci)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn OnMnemonic(&self, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(pmsg)).ok() } pub unsafe fn OnAmbientPropertyChange(&self, dispid: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn FreezeEvents<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, bfreeze: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), bfreeze.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleControl { type Vtable = IOleControl_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb196b288_bab4_101a_b69c_00aa00341d07); } impl ::core::convert::From<IOleControl> for ::windows::core::IUnknown { fn from(value: IOleControl) -> Self { value.0 } } impl ::core::convert::From<&IOleControl> for ::windows::core::IUnknown { fn from(value: &IOleControl) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleControl { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleControl { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleControl_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pci: *mut CONTROLINFO) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bfreeze: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleControlSite(pub ::windows::core::IUnknown); impl IOleControlSite { pub unsafe fn OnControlInfoChanged(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn LockInPlaceActive<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, flock: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), flock.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetExtendedControl(&self) -> ::windows::core::Result<super::Com::IDispatch> { let mut result__: <super::Com::IDispatch as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::IDispatch>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn TransformCoords(&self, pptlhimetric: *mut super::super::Foundation::POINTL, pptfcontainer: *mut POINTF, dwflags: XFORMCOORDS) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(pptlhimetric), ::core::mem::transmute(pptfcontainer), ::core::mem::transmute(dwflags)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn TranslateAccelerator(&self, pmsg: *const super::super::UI::WindowsAndMessaging::MSG, grfmodifiers: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(pmsg), ::core::mem::transmute(grfmodifiers)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnFocus<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fgotfocus: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), fgotfocus.into_param().abi()).ok() } pub unsafe fn ShowPropertyFrame(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IOleControlSite { type Vtable = IOleControlSite_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb196b289_bab4_101a_b69c_00aa00341d07); } impl ::core::convert::From<IOleControlSite> for ::windows::core::IUnknown { fn from(value: IOleControlSite) -> Self { value.0 } } impl ::core::convert::From<&IOleControlSite> for ::windows::core::IUnknown { fn from(value: &IOleControlSite) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleControlSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleControlSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleControlSite_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flock: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppdisp: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pptlhimetric: *mut super::super::Foundation::POINTL, pptfcontainer: *mut POINTF, dwflags: XFORMCOORDS) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmsg: *const super::super::UI::WindowsAndMessaging::MSG, grfmodifiers: u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fgotfocus: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleDocument(pub ::windows::core::IUnknown); impl IOleDocument { #[cfg(feature = "Win32_System_Com")] pub unsafe fn CreateView<'a, Param0: ::windows::core::IntoParam<'a, IOleInPlaceSite>, Param1: ::windows::core::IntoParam<'a, super::Com::IStream>>(&self, pipsite: Param0, pstm: Param1, dwreserved: u32) -> ::windows::core::Result<IOleDocumentView> { let mut result__: <IOleDocumentView as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pipsite.into_param().abi(), pstm.into_param().abi(), ::core::mem::transmute(dwreserved), &mut result__).from_abi::<IOleDocumentView>(result__) } pub unsafe fn GetDocMiscStatus(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } pub unsafe fn EnumViews(&self, ppenum: *mut ::core::option::Option<IEnumOleDocumentViews>, ppview: *mut ::core::option::Option<IOleDocumentView>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(ppenum), ::core::mem::transmute(ppview)).ok() } } unsafe impl ::windows::core::Interface for IOleDocument { type Vtable = IOleDocument_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb722bcc5_4e68_101b_a2bc_00aa00404770); } impl ::core::convert::From<IOleDocument> for ::windows::core::IUnknown { fn from(value: IOleDocument) -> Self { value.0 } } impl ::core::convert::From<&IOleDocument> for ::windows::core::IUnknown { fn from(value: &IOleDocument) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleDocument { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleDocument { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleDocument_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pipsite: ::windows::core::RawPtr, pstm: ::windows::core::RawPtr, dwreserved: u32, ppview: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwstatus: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenum: *mut ::windows::core::RawPtr, ppview: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleDocumentSite(pub ::windows::core::IUnknown); impl IOleDocumentSite { pub unsafe fn ActivateMe<'a, Param0: ::windows::core::IntoParam<'a, IOleDocumentView>>(&self, pviewtoactivate: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pviewtoactivate.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleDocumentSite { type Vtable = IOleDocumentSite_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb722bcc7_4e68_101b_a2bc_00aa00404770); } impl ::core::convert::From<IOleDocumentSite> for ::windows::core::IUnknown { fn from(value: IOleDocumentSite) -> Self { value.0 } } impl ::core::convert::From<&IOleDocumentSite> for ::windows::core::IUnknown { fn from(value: &IOleDocumentSite) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleDocumentSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleDocumentSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleDocumentSite_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pviewtoactivate: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleDocumentView(pub ::windows::core::IUnknown); impl IOleDocumentView { pub unsafe fn SetInPlaceSite<'a, Param0: ::windows::core::IntoParam<'a, IOleInPlaceSite>>(&self, pipsite: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pipsite.into_param().abi()).ok() } pub unsafe fn GetInPlaceSite(&self) -> ::windows::core::Result<IOleInPlaceSite> { let mut result__: <IOleInPlaceSite as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IOleInPlaceSite>(result__) } pub unsafe fn GetDocument(&self) -> ::windows::core::Result<::windows::core::IUnknown> { let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetRect(&self, prcview: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(prcview)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetRect(&self) -> ::windows::core::Result<super::super::Foundation::RECT> { let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetRectComplex(&self, prcview: *const super::super::Foundation::RECT, prchscroll: *const super::super::Foundation::RECT, prcvscroll: *const super::super::Foundation::RECT, prcsizebox: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(prcview), ::core::mem::transmute(prchscroll), ::core::mem::transmute(prcvscroll), ::core::mem::transmute(prcsizebox)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Show<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fshow: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), fshow.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn UIActivate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fuiactivate: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), fuiactivate.into_param().abi()).ok() } pub unsafe fn Open(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn CloseView(&self, dwreserved: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwreserved)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SaveViewState<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IStream>>(&self, pstm: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), pstm.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn ApplyViewState<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IStream>>(&self, pstm: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), pstm.into_param().abi()).ok() } pub unsafe fn Clone<'a, Param0: ::windows::core::IntoParam<'a, IOleInPlaceSite>>(&self, pipsitenew: Param0) -> ::windows::core::Result<IOleDocumentView> { let mut result__: <IOleDocumentView as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), pipsitenew.into_param().abi(), &mut result__).from_abi::<IOleDocumentView>(result__) } } unsafe impl ::windows::core::Interface for IOleDocumentView { type Vtable = IOleDocumentView_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb722bcc6_4e68_101b_a2bc_00aa00404770); } impl ::core::convert::From<IOleDocumentView> for ::windows::core::IUnknown { fn from(value: IOleDocumentView) -> Self { value.0 } } impl ::core::convert::From<&IOleDocumentView> for ::windows::core::IUnknown { fn from(value: &IOleDocumentView) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleDocumentView { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleDocumentView { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleDocumentView_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pipsite: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppipsite: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppunk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prcview: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prcview: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prcview: *const super::super::Foundation::RECT, prchscroll: *const super::super::Foundation::RECT, prcvscroll: *const super::super::Foundation::RECT, prcsizebox: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fshow: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fuiactivate: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwreserved: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstm: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstm: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pipsitenew: ::windows::core::RawPtr, ppviewnew: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceActiveObject(pub ::windows::core::IUnknown); impl IOleInPlaceActiveObject { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn TranslateAccelerator(&self, lpmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(lpmsg)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnFrameWindowActivate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, factivate: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), factivate.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnDocWindowActivate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, factivate: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), factivate.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ResizeBorder<'a, Param1: ::windows::core::IntoParam<'a, IOleInPlaceUIWindow>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, prcborder: *const super::super::Foundation::RECT, puiwindow: Param1, fframewindow: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(prcborder), puiwindow.into_param().abi(), fframewindow.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn EnableModeless<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fenable: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), fenable.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleInPlaceActiveObject { type Vtable = IOleInPlaceActiveObject_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000117_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleInPlaceActiveObject> for ::windows::core::IUnknown { fn from(value: IOleInPlaceActiveObject) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceActiveObject> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceActiveObject) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceActiveObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceActiveObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceActiveObject> for IOleWindow { fn from(value: IOleInPlaceActiveObject) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceActiveObject> for IOleWindow { fn from(value: &IOleInPlaceActiveObject) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceActiveObject { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceActiveObject { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceActiveObject_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lpmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, factivate: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, factivate: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prcborder: *const super::super::Foundation::RECT, puiwindow: ::windows::core::RawPtr, fframewindow: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fenable: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceFrame(pub ::windows::core::IUnknown); impl IOleInPlaceFrame { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetBorder(&self) -> ::windows::core::Result<super::super::Foundation::RECT> { let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn RequestBorderSpace(&self, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(pborderwidths)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetBorderSpace(&self, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(pborderwidths)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetActiveObject<'a, Param0: ::windows::core::IntoParam<'a, IOleInPlaceActiveObject>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pactiveobject: Param0, pszobjname: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), pactiveobject.into_param().abi(), pszobjname.into_param().abi()).ok() } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn InsertMenus<'a, Param0: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HMENU>>(&self, hmenushared: Param0, lpmenuwidths: *mut OleMenuGroupWidths) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), hmenushared.into_param().abi(), ::core::mem::transmute(lpmenuwidths)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn SetMenu<'a, Param0: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HMENU>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(&self, hmenushared: Param0, holemenu: isize, hwndactiveobject: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), hmenushared.into_param().abi(), ::core::mem::transmute(holemenu), hwndactiveobject.into_param().abi()).ok() } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn RemoveMenus<'a, Param0: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HMENU>>(&self, hmenushared: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), hmenushared.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetStatusText<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pszstatustext: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), pszstatustext.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn EnableModeless<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fenable: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fenable.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn TranslateAccelerator(&self, lpmsg: *const super::super::UI::WindowsAndMessaging::MSG, wid: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(lpmsg), ::core::mem::transmute(wid)).ok() } } unsafe impl ::windows::core::Interface for IOleInPlaceFrame { type Vtable = IOleInPlaceFrame_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000116_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleInPlaceFrame> for ::windows::core::IUnknown { fn from(value: IOleInPlaceFrame) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceFrame> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceFrame) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceFrame { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceFrame { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceFrame> for IOleInPlaceUIWindow { fn from(value: IOleInPlaceFrame) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceFrame> for IOleInPlaceUIWindow { fn from(value: &IOleInPlaceFrame) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceUIWindow> for IOleInPlaceFrame { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceUIWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceUIWindow> for &IOleInPlaceFrame { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceUIWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IOleInPlaceFrame> for IOleWindow { fn from(value: IOleInPlaceFrame) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceFrame> for IOleWindow { fn from(value: &IOleInPlaceFrame) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceFrame { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceFrame { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceFrame_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lprectborder: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pactiveobject: ::windows::core::RawPtr, pszobjname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hmenushared: super::super::UI::WindowsAndMessaging::HMENU, lpmenuwidths: *mut OleMenuGroupWidths) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hmenushared: super::super::UI::WindowsAndMessaging::HMENU, holemenu: isize, hwndactiveobject: super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hmenushared: super::super::UI::WindowsAndMessaging::HMENU) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszstatustext: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fenable: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lpmsg: *const super::super::UI::WindowsAndMessaging::MSG, wid: u16) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceObject(pub ::windows::core::IUnknown); impl IOleInPlaceObject { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } pub unsafe fn InPlaceDeactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn UIDeactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetObjectRects(&self, lprcposrect: *const super::super::Foundation::RECT, lprccliprect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(lprcposrect), ::core::mem::transmute(lprccliprect)).ok() } pub unsafe fn ReactivateAndUndo(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IOleInPlaceObject { type Vtable = IOleInPlaceObject_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000113_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleInPlaceObject> for ::windows::core::IUnknown { fn from(value: IOleInPlaceObject) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceObject> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceObject) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceObject> for IOleWindow { fn from(value: IOleInPlaceObject) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceObject> for IOleWindow { fn from(value: &IOleInPlaceObject) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceObject { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceObject { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceObject_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lprcposrect: *const super::super::Foundation::RECT, lprccliprect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceObjectWindowless(pub ::windows::core::IUnknown); impl IOleInPlaceObjectWindowless { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } pub unsafe fn InPlaceDeactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn UIDeactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetObjectRects(&self, lprcposrect: *const super::super::Foundation::RECT, lprccliprect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(lprcposrect), ::core::mem::transmute(lprccliprect)).ok() } pub unsafe fn ReactivateAndUndo(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnWindowMessage<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::WPARAM>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(&self, msg: u32, wparam: Param1, lparam: Param2) -> ::windows::core::Result<super::super::Foundation::LRESULT> { let mut result__: <super::super::Foundation::LRESULT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(msg), wparam.into_param().abi(), lparam.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::LRESULT>(result__) } pub unsafe fn GetDropTarget(&self) -> ::windows::core::Result<IDropTarget> { let mut result__: <IDropTarget as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDropTarget>(result__) } } unsafe impl ::windows::core::Interface for IOleInPlaceObjectWindowless { type Vtable = IOleInPlaceObjectWindowless_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1c2056cc_5ef4_101b_8bc8_00aa003e3b29); } impl ::core::convert::From<IOleInPlaceObjectWindowless> for ::windows::core::IUnknown { fn from(value: IOleInPlaceObjectWindowless) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceObjectWindowless> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceObjectWindowless) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceObjectWindowless { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceObjectWindowless { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceObjectWindowless> for IOleInPlaceObject { fn from(value: IOleInPlaceObjectWindowless) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceObjectWindowless> for IOleInPlaceObject { fn from(value: &IOleInPlaceObjectWindowless) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceObject> for IOleInPlaceObjectWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceObject> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceObject> for &IOleInPlaceObjectWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceObject> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IOleInPlaceObjectWindowless> for IOleWindow { fn from(value: IOleInPlaceObjectWindowless) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceObjectWindowless> for IOleWindow { fn from(value: &IOleInPlaceObjectWindowless) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceObjectWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceObjectWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceObjectWindowless_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lprcposrect: *const super::super::Foundation::RECT, lprccliprect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, msg: u32, wparam: super::super::Foundation::WPARAM, lparam: super::super::Foundation::LPARAM, plresult: *mut super::super::Foundation::LRESULT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppdroptarget: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceSite(pub ::windows::core::IUnknown); impl IOleInPlaceSite { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } pub unsafe fn CanInPlaceActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn OnInPlaceActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn OnUIActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn GetWindowContext(&self, ppframe: *mut ::core::option::Option<IOleInPlaceFrame>, ppdoc: *mut ::core::option::Option<IOleInPlaceUIWindow>, lprcposrect: *mut super::super::Foundation::RECT, lprccliprect: *mut super::super::Foundation::RECT, lpframeinfo: *mut OIFI) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(ppframe), ::core::mem::transmute(ppdoc), ::core::mem::transmute(lprcposrect), ::core::mem::transmute(lprccliprect), ::core::mem::transmute(lpframeinfo)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Scroll<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::SIZE>>(&self, scrollextant: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), scrollextant.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnUIDeactivate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fundoable: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), fundoable.into_param().abi()).ok() } pub unsafe fn OnInPlaceDeactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn DiscardUndoState(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn DeactivateAndUndo(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnPosRectChange(&self, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(lprcposrect)).ok() } } unsafe impl ::windows::core::Interface for IOleInPlaceSite { type Vtable = IOleInPlaceSite_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000119_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleInPlaceSite> for ::windows::core::IUnknown { fn from(value: IOleInPlaceSite) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceSite> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceSite) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceSite> for IOleWindow { fn from(value: IOleInPlaceSite) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceSite> for IOleWindow { fn from(value: &IOleInPlaceSite) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceSite { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceSite { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceSite_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppframe: *mut ::windows::core::RawPtr, ppdoc: *mut ::windows::core::RawPtr, lprcposrect: *mut super::super::Foundation::RECT, lprccliprect: *mut super::super::Foundation::RECT, lpframeinfo: *mut OIFI) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, scrollextant: super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fundoable: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceSiteEx(pub ::windows::core::IUnknown); impl IOleInPlaceSiteEx { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } pub unsafe fn CanInPlaceActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn OnInPlaceActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn OnUIActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn GetWindowContext(&self, ppframe: *mut ::core::option::Option<IOleInPlaceFrame>, ppdoc: *mut ::core::option::Option<IOleInPlaceUIWindow>, lprcposrect: *mut super::super::Foundation::RECT, lprccliprect: *mut super::super::Foundation::RECT, lpframeinfo: *mut OIFI) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(ppframe), ::core::mem::transmute(ppdoc), ::core::mem::transmute(lprcposrect), ::core::mem::transmute(lprccliprect), ::core::mem::transmute(lpframeinfo)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Scroll<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::SIZE>>(&self, scrollextant: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), scrollextant.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnUIDeactivate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fundoable: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), fundoable.into_param().abi()).ok() } pub unsafe fn OnInPlaceDeactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn DiscardUndoState(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn DeactivateAndUndo(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnPosRectChange(&self, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(lprcposrect)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnInPlaceActivateEx(&self, pfnoredraw: *mut super::super::Foundation::BOOL, dwflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(pfnoredraw), ::core::mem::transmute(dwflags)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnInPlaceDeactivateEx<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fnoredraw: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), fnoredraw.into_param().abi()).ok() } pub unsafe fn RequestUIActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IOleInPlaceSiteEx { type Vtable = IOleInPlaceSiteEx_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9c2cad80_3424_11cf_b670_00aa004cd6d8); } impl ::core::convert::From<IOleInPlaceSiteEx> for ::windows::core::IUnknown { fn from(value: IOleInPlaceSiteEx) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceSiteEx> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceSiteEx) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceSiteEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceSiteEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceSiteEx> for IOleInPlaceSite { fn from(value: IOleInPlaceSiteEx) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceSiteEx> for IOleInPlaceSite { fn from(value: &IOleInPlaceSiteEx) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceSite> for IOleInPlaceSiteEx { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceSite> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceSite> for &IOleInPlaceSiteEx { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceSite> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IOleInPlaceSiteEx> for IOleWindow { fn from(value: IOleInPlaceSiteEx) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceSiteEx> for IOleWindow { fn from(value: &IOleInPlaceSiteEx) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceSiteEx { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceSiteEx { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceSiteEx_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppframe: *mut ::windows::core::RawPtr, ppdoc: *mut ::windows::core::RawPtr, lprcposrect: *mut super::super::Foundation::RECT, lprccliprect: *mut super::super::Foundation::RECT, lpframeinfo: *mut OIFI) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, scrollextant: super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fundoable: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pfnoredraw: *mut super::super::Foundation::BOOL, dwflags: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fnoredraw: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceSiteWindowless(pub ::windows::core::IUnknown); impl IOleInPlaceSiteWindowless { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } pub unsafe fn CanInPlaceActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn OnInPlaceActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn OnUIActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn GetWindowContext(&self, ppframe: *mut ::core::option::Option<IOleInPlaceFrame>, ppdoc: *mut ::core::option::Option<IOleInPlaceUIWindow>, lprcposrect: *mut super::super::Foundation::RECT, lprccliprect: *mut super::super::Foundation::RECT, lpframeinfo: *mut OIFI) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(ppframe), ::core::mem::transmute(ppdoc), ::core::mem::transmute(lprcposrect), ::core::mem::transmute(lprccliprect), ::core::mem::transmute(lpframeinfo)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Scroll<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::SIZE>>(&self, scrollextant: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), scrollextant.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnUIDeactivate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fundoable: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), fundoable.into_param().abi()).ok() } pub unsafe fn OnInPlaceDeactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn DiscardUndoState(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn DeactivateAndUndo(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnPosRectChange(&self, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(lprcposrect)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnInPlaceActivateEx(&self, pfnoredraw: *mut super::super::Foundation::BOOL, dwflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(pfnoredraw), ::core::mem::transmute(dwflags)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnInPlaceDeactivateEx<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fnoredraw: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), fnoredraw.into_param().abi()).ok() } pub unsafe fn RequestUIActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn CanWindowlessActivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn GetCapture(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetCapture<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fcapture: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), fcapture.into_param().abi()).ok() } pub unsafe fn GetFocus(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetFocus<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ffocus: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ffocus.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe fn GetDC(&self, prect: *const super::super::Foundation::RECT, grfflags: u32) -> ::windows::core::Result<super::super::Graphics::Gdi::HDC> { let mut result__: <super::super::Graphics::Gdi::HDC as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(prect), ::core::mem::transmute(grfflags), &mut result__).from_abi::<super::super::Graphics::Gdi::HDC>(result__) } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn ReleaseDC<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, hdc: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), hdc.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn InvalidateRect<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, prect: *const super::super::Foundation::RECT, ferase: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(prect), ferase.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe fn InvalidateRgn<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HRGN>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, hrgn: Param0, ferase: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), hrgn.into_param().abi(), ferase.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ScrollRect(&self, dx: i32, dy: i32, prectscroll: *const super::super::Foundation::RECT, prectclip: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(dx), ::core::mem::transmute(dy), ::core::mem::transmute(prectscroll), ::core::mem::transmute(prectclip)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn AdjustRect(&self, prc: *mut super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(prc)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnDefWindowMessage<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::WPARAM>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(&self, msg: u32, wparam: Param1, lparam: Param2) -> ::windows::core::Result<super::super::Foundation::LRESULT> { let mut result__: <super::super::Foundation::LRESULT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(msg), wparam.into_param().abi(), lparam.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::LRESULT>(result__) } } unsafe impl ::windows::core::Interface for IOleInPlaceSiteWindowless { type Vtable = IOleInPlaceSiteWindowless_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x922eada0_3424_11cf_b670_00aa004cd6d8); } impl ::core::convert::From<IOleInPlaceSiteWindowless> for ::windows::core::IUnknown { fn from(value: IOleInPlaceSiteWindowless) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceSiteWindowless> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceSiteWindowless) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceSiteWindowless> for IOleInPlaceSiteEx { fn from(value: IOleInPlaceSiteWindowless) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceSiteWindowless> for IOleInPlaceSiteEx { fn from(value: &IOleInPlaceSiteWindowless) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceSiteEx> for IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceSiteEx> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceSiteEx> for &IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceSiteEx> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IOleInPlaceSiteWindowless> for IOleInPlaceSite { fn from(value: IOleInPlaceSiteWindowless) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceSiteWindowless> for IOleInPlaceSite { fn from(value: &IOleInPlaceSiteWindowless) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceSite> for IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceSite> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleInPlaceSite> for &IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleInPlaceSite> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IOleInPlaceSiteWindowless> for IOleWindow { fn from(value: IOleInPlaceSiteWindowless) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceSiteWindowless> for IOleWindow { fn from(value: &IOleInPlaceSiteWindowless) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceSiteWindowless { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceSiteWindowless_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppframe: *mut ::windows::core::RawPtr, ppdoc: *mut ::windows::core::RawPtr, lprcposrect: *mut super::super::Foundation::RECT, lprccliprect: *mut super::super::Foundation::RECT, lpframeinfo: *mut OIFI) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, scrollextant: super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fundoable: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pfnoredraw: *mut super::super::Foundation::BOOL, dwflags: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fnoredraw: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fcapture: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ffocus: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prect: *const super::super::Foundation::RECT, grfflags: u32, phdc: *mut super::super::Graphics::Gdi::HDC) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::super::Graphics::Gdi::HDC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prect: *const super::super::Foundation::RECT, ferase: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hrgn: super::super::Graphics::Gdi::HRGN, ferase: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dx: i32, dy: i32, prectscroll: *const super::super::Foundation::RECT, prectclip: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prc: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, msg: u32, wparam: super::super::Foundation::WPARAM, lparam: super::super::Foundation::LPARAM, plresult: *mut super::super::Foundation::LRESULT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleInPlaceUIWindow(pub ::windows::core::IUnknown); impl IOleInPlaceUIWindow { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetBorder(&self) -> ::windows::core::Result<super::super::Foundation::RECT> { let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn RequestBorderSpace(&self, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(pborderwidths)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetBorderSpace(&self, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(pborderwidths)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetActiveObject<'a, Param0: ::windows::core::IntoParam<'a, IOleInPlaceActiveObject>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pactiveobject: Param0, pszobjname: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), pactiveobject.into_param().abi(), pszobjname.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleInPlaceUIWindow { type Vtable = IOleInPlaceUIWindow_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000115_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleInPlaceUIWindow> for ::windows::core::IUnknown { fn from(value: IOleInPlaceUIWindow) -> Self { value.0 } } impl ::core::convert::From<&IOleInPlaceUIWindow> for ::windows::core::IUnknown { fn from(value: &IOleInPlaceUIWindow) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleInPlaceUIWindow { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleInPlaceUIWindow { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleInPlaceUIWindow> for IOleWindow { fn from(value: IOleInPlaceUIWindow) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleInPlaceUIWindow> for IOleWindow { fn from(value: &IOleInPlaceUIWindow) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for IOleInPlaceUIWindow { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleWindow> for &IOleInPlaceUIWindow { fn into_param(self) -> ::windows::core::Param<'a, IOleWindow> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleInPlaceUIWindow_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lprectborder: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pborderwidths: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pactiveobject: ::windows::core::RawPtr, pszobjname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleItemContainer(pub ::windows::core::IUnknown); impl IOleItemContainer { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn ParseDisplayName<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IBindCtx>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pbc: Param0, pszdisplayname: Param1, pcheaten: *mut u32, ppmkout: *mut ::core::option::Option<super::Com::IMoniker>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pbc.into_param().abi(), pszdisplayname.into_param().abi(), ::core::mem::transmute(pcheaten), ::core::mem::transmute(ppmkout)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn EnumObjects(&self, grfflags: u32) -> ::windows::core::Result<super::Com::IEnumUnknown> { let mut result__: <super::Com::IEnumUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(grfflags), &mut result__).from_abi::<super::Com::IEnumUnknown>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn LockContainer<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, flock: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), flock.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn GetObject<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::Com::IBindCtx>, T: ::windows::core::Interface>(&self, pszitem: Param0, dwspeedneeded: u32, pbc: Param2) -> ::windows::core::Result<T> { let mut result__ = ::core::option::Option::None; (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), pszitem.into_param().abi(), ::core::mem::transmute(dwspeedneeded), pbc.into_param().abi(), &<T as ::windows::core::Interface>::IID, &mut result__ as *mut _ as *mut _).and_some(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn GetObjectStorage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::Com::IBindCtx>, T: ::windows::core::Interface>(&self, pszitem: Param0, pbc: Param1) -> ::windows::core::Result<T> { let mut result__ = ::core::option::Option::None; (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), pszitem.into_param().abi(), pbc.into_param().abi(), &<T as ::windows::core::Interface>::IID, &mut result__ as *mut _ as *mut _).and_some(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn IsRunning<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pszitem: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), pszitem.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleItemContainer { type Vtable = IOleItemContainer_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000011c_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleItemContainer> for ::windows::core::IUnknown { fn from(value: IOleItemContainer) -> Self { value.0 } } impl ::core::convert::From<&IOleItemContainer> for ::windows::core::IUnknown { fn from(value: &IOleItemContainer) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleItemContainer { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleItemContainer { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleItemContainer> for IOleContainer { fn from(value: IOleItemContainer) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleItemContainer> for IOleContainer { fn from(value: &IOleItemContainer) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleContainer> for IOleItemContainer { fn into_param(self) -> ::windows::core::Param<'a, IOleContainer> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleContainer> for &IOleItemContainer { fn into_param(self) -> ::windows::core::Param<'a, IOleContainer> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IOleItemContainer> for IParseDisplayName { fn from(value: IOleItemContainer) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleItemContainer> for IParseDisplayName { fn from(value: &IOleItemContainer) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IParseDisplayName> for IOleItemContainer { fn into_param(self) -> ::windows::core::Param<'a, IParseDisplayName> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IParseDisplayName> for &IOleItemContainer { fn into_param(self) -> ::windows::core::Param<'a, IParseDisplayName> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleItemContainer_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbc: ::windows::core::RawPtr, pszdisplayname: super::super::Foundation::PWSTR, pcheaten: *mut u32, ppmkout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, grfflags: u32, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flock: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszitem: super::super::Foundation::PWSTR, dwspeedneeded: u32, pbc: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppvobject: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszitem: super::super::Foundation::PWSTR, pbc: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppvstorage: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszitem: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleLink(pub ::windows::core::IUnknown); impl IOleLink { pub unsafe fn SetUpdateOptions(&self, dwupdateopt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwupdateopt)).ok() } pub unsafe fn GetUpdateOptions(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetSourceMoniker<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IMoniker>>(&self, pmk: Param0, rclsid: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), pmk.into_param().abi(), ::core::mem::transmute(rclsid)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetSourceMoniker(&self) -> ::windows::core::Result<super::Com::IMoniker> { let mut result__: <super::Com::IMoniker as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::IMoniker>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetSourceDisplayName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pszstatustext: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), pszstatustext.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetSourceDisplayName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> { let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn BindToSource<'a, Param1: ::windows::core::IntoParam<'a, super::Com::IBindCtx>>(&self, bindflags: u32, pbc: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(bindflags), pbc.into_param().abi()).ok() } pub unsafe fn BindIfRunning(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn GetBoundSource(&self) -> ::windows::core::Result<::windows::core::IUnknown> { let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__) } pub unsafe fn UnbindSource(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn Update<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IBindCtx>>(&self, pbc: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), pbc.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleLink { type Vtable = IOleLink_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000011d_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleLink> for ::windows::core::IUnknown { fn from(value: IOleLink) -> Self { value.0 } } impl ::core::convert::From<&IOleLink> for ::windows::core::IUnknown { fn from(value: &IOleLink) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleLink { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleLink { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleLink_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwupdateopt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwupdateopt: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmk: ::windows::core::RawPtr, rclsid: *const ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppmk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszstatustext: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppszdisplayname: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bindflags: u32, pbc: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppunk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbc: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleObject(pub ::windows::core::IUnknown); impl IOleObject { pub unsafe fn SetClientSite<'a, Param0: ::windows::core::IntoParam<'a, IOleClientSite>>(&self, pclientsite: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pclientsite.into_param().abi()).ok() } pub unsafe fn GetClientSite(&self) -> ::windows::core::Result<IOleClientSite> { let mut result__: <IOleClientSite as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IOleClientSite>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetHostNames<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, szcontainerapp: Param0, szcontainerobj: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), szcontainerapp.into_param().abi(), szcontainerobj.into_param().abi()).ok() } pub unsafe fn Close(&self, dwsaveoption: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwsaveoption)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetMoniker<'a, Param1: ::windows::core::IntoParam<'a, super::Com::IMoniker>>(&self, dwwhichmoniker: u32, pmk: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwwhichmoniker), pmk.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetMoniker(&self, dwassign: u32, dwwhichmoniker: u32) -> ::windows::core::Result<super::Com::IMoniker> { let mut result__: <super::Com::IMoniker as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwassign), ::core::mem::transmute(dwwhichmoniker), &mut result__).from_abi::<super::Com::IMoniker>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn InitFromData<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pdataobject: Param0, fcreation: Param1, dwreserved: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), pdataobject.into_param().abi(), fcreation.into_param().abi(), ::core::mem::transmute(dwreserved)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetClipboardData(&self, dwreserved: u32) -> ::windows::core::Result<super::Com::IDataObject> { let mut result__: <super::Com::IDataObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwreserved), &mut result__).from_abi::<super::Com::IDataObject>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn DoVerb<'a, Param2: ::windows::core::IntoParam<'a, IOleClientSite>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(&self, iverb: i32, lpmsg: *const super::super::UI::WindowsAndMessaging::MSG, pactivesite: Param2, lindex: i32, hwndparent: Param4, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(iverb), ::core::mem::transmute(lpmsg), pactivesite.into_param().abi(), ::core::mem::transmute(lindex), hwndparent.into_param().abi(), ::core::mem::transmute(lprcposrect)).ok() } pub unsafe fn EnumVerbs(&self) -> ::windows::core::Result<IEnumOLEVERB> { let mut result__: <IEnumOLEVERB as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IEnumOLEVERB>(result__) } pub unsafe fn Update(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn IsUpToDate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn GetUserClassID(&self) -> ::windows::core::Result<::windows::core::GUID> { let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::GUID>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetUserType(&self, dwformoftype: u32) -> ::windows::core::Result<super::super::Foundation::PWSTR> { let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwformoftype), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetExtent(&self, dwdrawaspect: u32, psizel: *const super::super::Foundation::SIZE) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(psizel)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetExtent(&self, dwdrawaspect: u32) -> ::windows::core::Result<super::super::Foundation::SIZE> { let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn Advise<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>>(&self, padvsink: Param0) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), padvsink.into_param().abi(), &mut result__).from_abi::<u32>(result__) } pub unsafe fn Unadvise(&self, dwconnection: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwconnection)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn EnumAdvise(&self) -> ::windows::core::Result<super::Com::IEnumSTATDATA> { let mut result__: <super::Com::IEnumSTATDATA as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::IEnumSTATDATA>(result__) } pub unsafe fn GetMiscStatus(&self, dwaspect: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwaspect), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn SetColorScheme(&self, plogpal: *const super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(plogpal)).ok() } } unsafe impl ::windows::core::Interface for IOleObject { type Vtable = IOleObject_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000112_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleObject> for ::windows::core::IUnknown { fn from(value: IOleObject) -> Self { value.0 } } impl ::core::convert::From<&IOleObject> for ::windows::core::IUnknown { fn from(value: &IOleObject) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleObject_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclientsite: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppclientsite: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, szcontainerapp: super::super::Foundation::PWSTR, szcontainerobj: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwsaveoption: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwwhichmoniker: u32, pmk: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwassign: u32, dwwhichmoniker: u32, ppmk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdataobject: ::windows::core::RawPtr, fcreation: super::super::Foundation::BOOL, dwreserved: u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwreserved: u32, ppdataobject: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iverb: i32, lpmsg: *const super::super::UI::WindowsAndMessaging::MSG, pactivesite: ::windows::core::RawPtr, lindex: i32, hwndparent: super::super::Foundation::HWND, lprcposrect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenumoleverb: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclsid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwformoftype: u32, pszusertype: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, psizel: *const super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, psizel: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, padvsink: ::windows::core::RawPtr, pdwconnection: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwconnection: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenumadvise: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwaspect: u32, pdwstatus: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, plogpal: *const super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleParentUndoUnit(pub ::windows::core::IUnknown); impl IOleParentUndoUnit { pub unsafe fn Do<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoManager>>(&self, pundomanager: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pundomanager.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetDescription(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } pub unsafe fn GetUnitType(&self, pclsid: *mut ::windows::core::GUID, plid: *mut i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(pclsid), ::core::mem::transmute(plid)).ok() } pub unsafe fn OnNextAdd(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn Open<'a, Param0: ::windows::core::IntoParam<'a, IOleParentUndoUnit>>(&self, ppuu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ppuu.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Close<'a, Param0: ::windows::core::IntoParam<'a, IOleParentUndoUnit>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ppuu: Param0, fcommit: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ppuu.into_param().abi(), fcommit.into_param().abi()).ok() } pub unsafe fn Add<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoUnit>>(&self, puu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), puu.into_param().abi()).ok() } pub unsafe fn FindUnit<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoUnit>>(&self, puu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), puu.into_param().abi()).ok() } pub unsafe fn GetParentState(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } } unsafe impl ::windows::core::Interface for IOleParentUndoUnit { type Vtable = IOleParentUndoUnit_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa1faf330_ef97_11ce_9bc9_00aa00608e01); } impl ::core::convert::From<IOleParentUndoUnit> for ::windows::core::IUnknown { fn from(value: IOleParentUndoUnit) -> Self { value.0 } } impl ::core::convert::From<&IOleParentUndoUnit> for ::windows::core::IUnknown { fn from(value: &IOleParentUndoUnit) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleParentUndoUnit { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleParentUndoUnit { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleParentUndoUnit> for IOleUndoUnit { fn from(value: IOleParentUndoUnit) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleParentUndoUnit> for IOleUndoUnit { fn from(value: &IOleParentUndoUnit) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleUndoUnit> for IOleParentUndoUnit { fn into_param(self) -> ::windows::core::Param<'a, IOleUndoUnit> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleUndoUnit> for &IOleParentUndoUnit { fn into_param(self) -> ::windows::core::Param<'a, IOleUndoUnit> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleParentUndoUnit_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pundomanager: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstr: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclsid: *mut ::windows::core::GUID, plid: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppuu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppuu: ::windows::core::RawPtr, fcommit: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, puu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, puu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwstate: *mut u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUILinkContainerA(pub ::windows::core::IUnknown); impl IOleUILinkContainerA { pub unsafe fn GetNextLink(&self, dwlink: u32) -> u32 { ::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink))) } pub unsafe fn SetLinkUpdateOptions(&self, dwlink: u32, dwupdateopt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(dwupdateopt)).ok() } pub unsafe fn GetLinkUpdateOptions(&self, dwlink: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetLinkSource<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, lpszdisplayname: Param1, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: Param4) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), lpszdisplayname.into_param().abi(), ::core::mem::transmute(lenfilename), ::core::mem::transmute(pcheaten), fvalidatesource.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLinkSource(&self, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PSTR, lplpszshortlinktype: *mut super::super::Foundation::PSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)( ::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(lplpszdisplayname), ::core::mem::transmute(lplenfilename), ::core::mem::transmute(lplpszfulllinktype), ::core::mem::transmute(lplpszshortlinktype), ::core::mem::transmute(lpfsourceavailable), ::core::mem::transmute(lpfisselected), ) .ok() } pub unsafe fn OpenLinkSource(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn UpdateLink<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, ferrormessage: Param1, freserved: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ferrormessage.into_param().abi(), freserved.into_param().abi()).ok() } pub unsafe fn CancelLink(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } } unsafe impl ::windows::core::Interface for IOleUILinkContainerA { type Vtable = IOleUILinkContainerA_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::zeroed(); } impl ::core::convert::From<IOleUILinkContainerA> for ::windows::core::IUnknown { fn from(value: IOleUILinkContainerA) -> Self { value.0 } } impl ::core::convert::From<&IOleUILinkContainerA> for ::windows::core::IUnknown { fn from(value: &IOleUILinkContainerA) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUILinkContainerA { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUILinkContainerA { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleUILinkContainerA_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, dwupdateopt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpdwupdateopt: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpszdisplayname: super::super::Foundation::PSTR, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PSTR, lplpszshortlinktype: *mut super::super::Foundation::PSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, ferrormessage: super::super::Foundation::BOOL, freserved: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUILinkContainerW(pub ::windows::core::IUnknown); impl IOleUILinkContainerW { pub unsafe fn GetNextLink(&self, dwlink: u32) -> u32 { ::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink))) } pub unsafe fn SetLinkUpdateOptions(&self, dwlink: u32, dwupdateopt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(dwupdateopt)).ok() } pub unsafe fn GetLinkUpdateOptions(&self, dwlink: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetLinkSource<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, lpszdisplayname: Param1, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: Param4) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), lpszdisplayname.into_param().abi(), ::core::mem::transmute(lenfilename), ::core::mem::transmute(pcheaten), fvalidatesource.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLinkSource(&self, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PWSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PWSTR, lplpszshortlinktype: *mut super::super::Foundation::PWSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)( ::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(lplpszdisplayname), ::core::mem::transmute(lplenfilename), ::core::mem::transmute(lplpszfulllinktype), ::core::mem::transmute(lplpszshortlinktype), ::core::mem::transmute(lpfsourceavailable), ::core::mem::transmute(lpfisselected), ) .ok() } pub unsafe fn OpenLinkSource(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn UpdateLink<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, ferrormessage: Param1, freserved: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ferrormessage.into_param().abi(), freserved.into_param().abi()).ok() } pub unsafe fn CancelLink(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } } unsafe impl ::windows::core::Interface for IOleUILinkContainerW { type Vtable = IOleUILinkContainerW_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::zeroed(); } impl ::core::convert::From<IOleUILinkContainerW> for ::windows::core::IUnknown { fn from(value: IOleUILinkContainerW) -> Self { value.0 } } impl ::core::convert::From<&IOleUILinkContainerW> for ::windows::core::IUnknown { fn from(value: &IOleUILinkContainerW) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUILinkContainerW { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUILinkContainerW { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleUILinkContainerW_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, dwupdateopt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpdwupdateopt: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpszdisplayname: super::super::Foundation::PWSTR, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PWSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PWSTR, lplpszshortlinktype: *mut super::super::Foundation::PWSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, ferrormessage: super::super::Foundation::BOOL, freserved: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUILinkInfoA(pub ::windows::core::IUnknown); impl IOleUILinkInfoA { pub unsafe fn GetNextLink(&self, dwlink: u32) -> u32 { ::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink))) } pub unsafe fn SetLinkUpdateOptions(&self, dwlink: u32, dwupdateopt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(dwupdateopt)).ok() } pub unsafe fn GetLinkUpdateOptions(&self, dwlink: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetLinkSource<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, lpszdisplayname: Param1, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: Param4) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), lpszdisplayname.into_param().abi(), ::core::mem::transmute(lenfilename), ::core::mem::transmute(pcheaten), fvalidatesource.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLinkSource(&self, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PSTR, lplpszshortlinktype: *mut super::super::Foundation::PSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)( ::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(lplpszdisplayname), ::core::mem::transmute(lplenfilename), ::core::mem::transmute(lplpszfulllinktype), ::core::mem::transmute(lplpszshortlinktype), ::core::mem::transmute(lpfsourceavailable), ::core::mem::transmute(lpfisselected), ) .ok() } pub unsafe fn OpenLinkSource(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn UpdateLink<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, ferrormessage: Param1, freserved: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ferrormessage.into_param().abi(), freserved.into_param().abi()).ok() } pub unsafe fn CancelLink(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLastUpdate(&self, dwlink: u32) -> ::windows::core::Result<super::super::Foundation::FILETIME> { let mut result__: <super::super::Foundation::FILETIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), &mut result__).from_abi::<super::super::Foundation::FILETIME>(result__) } } unsafe impl ::windows::core::Interface for IOleUILinkInfoA { type Vtable = IOleUILinkInfoA_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::zeroed(); } impl ::core::convert::From<IOleUILinkInfoA> for ::windows::core::IUnknown { fn from(value: IOleUILinkInfoA) -> Self { value.0 } } impl ::core::convert::From<&IOleUILinkInfoA> for ::windows::core::IUnknown { fn from(value: &IOleUILinkInfoA) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUILinkInfoA { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUILinkInfoA { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleUILinkInfoA> for IOleUILinkContainerA { fn from(value: IOleUILinkInfoA) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleUILinkInfoA> for IOleUILinkContainerA { fn from(value: &IOleUILinkInfoA) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleUILinkContainerA> for IOleUILinkInfoA { fn into_param(self) -> ::windows::core::Param<'a, IOleUILinkContainerA> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleUILinkContainerA> for &IOleUILinkInfoA { fn into_param(self) -> ::windows::core::Param<'a, IOleUILinkContainerA> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleUILinkInfoA_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, dwupdateopt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpdwupdateopt: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpszdisplayname: super::super::Foundation::PSTR, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PSTR, lplpszshortlinktype: *mut super::super::Foundation::PSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, ferrormessage: super::super::Foundation::BOOL, freserved: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lplastupdate: *mut super::super::Foundation::FILETIME) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUILinkInfoW(pub ::windows::core::IUnknown); impl IOleUILinkInfoW { pub unsafe fn GetNextLink(&self, dwlink: u32) -> u32 { ::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink))) } pub unsafe fn SetLinkUpdateOptions(&self, dwlink: u32, dwupdateopt: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(dwupdateopt)).ok() } pub unsafe fn GetLinkUpdateOptions(&self, dwlink: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetLinkSource<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, lpszdisplayname: Param1, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: Param4) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), lpszdisplayname.into_param().abi(), ::core::mem::transmute(lenfilename), ::core::mem::transmute(pcheaten), fvalidatesource.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLinkSource(&self, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PWSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PWSTR, lplpszshortlinktype: *mut super::super::Foundation::PWSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)( ::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ::core::mem::transmute(lplpszdisplayname), ::core::mem::transmute(lplenfilename), ::core::mem::transmute(lplpszfulllinktype), ::core::mem::transmute(lplpszshortlinktype), ::core::mem::transmute(lpfsourceavailable), ::core::mem::transmute(lpfisselected), ) .ok() } pub unsafe fn OpenLinkSource(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn UpdateLink<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwlink: u32, ferrormessage: Param1, freserved: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), ferrormessage.into_param().abi(), freserved.into_param().abi()).ok() } pub unsafe fn CancelLink(&self, dwlink: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLastUpdate(&self, dwlink: u32) -> ::windows::core::Result<super::super::Foundation::FILETIME> { let mut result__: <super::super::Foundation::FILETIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwlink), &mut result__).from_abi::<super::super::Foundation::FILETIME>(result__) } } unsafe impl ::windows::core::Interface for IOleUILinkInfoW { type Vtable = IOleUILinkInfoW_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::zeroed(); } impl ::core::convert::From<IOleUILinkInfoW> for ::windows::core::IUnknown { fn from(value: IOleUILinkInfoW) -> Self { value.0 } } impl ::core::convert::From<&IOleUILinkInfoW> for ::windows::core::IUnknown { fn from(value: &IOleUILinkInfoW) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUILinkInfoW { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUILinkInfoW { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IOleUILinkInfoW> for IOleUILinkContainerW { fn from(value: IOleUILinkInfoW) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IOleUILinkInfoW> for IOleUILinkContainerW { fn from(value: &IOleUILinkInfoW) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IOleUILinkContainerW> for IOleUILinkInfoW { fn into_param(self) -> ::windows::core::Param<'a, IOleUILinkContainerW> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IOleUILinkContainerW> for &IOleUILinkInfoW { fn into_param(self) -> ::windows::core::Param<'a, IOleUILinkContainerW> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IOleUILinkInfoW_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, dwupdateopt: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpdwupdateopt: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lpszdisplayname: super::super::Foundation::PWSTR, lenfilename: u32, pcheaten: *mut u32, fvalidatesource: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lplpszdisplayname: *mut super::super::Foundation::PWSTR, lplenfilename: *mut u32, lplpszfulllinktype: *mut super::super::Foundation::PWSTR, lplpszshortlinktype: *mut super::super::Foundation::PWSTR, lpfsourceavailable: *mut super::super::Foundation::BOOL, lpfisselected: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, ferrormessage: super::super::Foundation::BOOL, freserved: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwlink: u32, lplastupdate: *mut super::super::Foundation::FILETIME) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUIObjInfoA(pub ::windows::core::IUnknown); impl IOleUIObjInfoA { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetObjectInfo(&self, dwobject: u32, lpdwobjsize: *mut u32, lplpszlabel: *mut super::super::Foundation::PSTR, lplpsztype: *mut super::super::Foundation::PSTR, lplpszshorttype: *mut super::super::Foundation::PSTR, lplpszlocation: *mut super::super::Foundation::PSTR) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(lpdwobjsize), ::core::mem::transmute(lplpszlabel), ::core::mem::transmute(lplpsztype), ::core::mem::transmute(lplpszshorttype), ::core::mem::transmute(lplpszlocation)).ok() } pub unsafe fn GetConvertInfo(&self, dwobject: u32, lpclassid: *mut ::windows::core::GUID, lpwformat: *mut u16, lpconvertdefaultclassid: *mut ::windows::core::GUID, lplpclsidexclude: *mut *mut ::windows::core::GUID, lpcclsidexclude: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(lpclassid), ::core::mem::transmute(lpwformat), ::core::mem::transmute(lpconvertdefaultclassid), ::core::mem::transmute(lplpclsidexclude), ::core::mem::transmute(lpcclsidexclude)).ok() } pub unsafe fn ConvertObject(&self, dwobject: u32, clsidnew: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(clsidnew)).ok() } pub unsafe fn GetViewInfo(&self, dwobject: u32, phmetapict: *const isize, pdvaspect: *const u32, pncurrentscale: *const i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(phmetapict), ::core::mem::transmute(pdvaspect), ::core::mem::transmute(pncurrentscale)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetViewInfo<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwobject: u32, hmetapict: isize, dvaspect: u32, ncurrentscale: i32, brelativetoorig: Param4) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(hmetapict), ::core::mem::transmute(dvaspect), ::core::mem::transmute(ncurrentscale), brelativetoorig.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleUIObjInfoA { type Vtable = IOleUIObjInfoA_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::zeroed(); } impl ::core::convert::From<IOleUIObjInfoA> for ::windows::core::IUnknown { fn from(value: IOleUIObjInfoA) -> Self { value.0 } } impl ::core::convert::From<&IOleUIObjInfoA> for ::windows::core::IUnknown { fn from(value: &IOleUIObjInfoA) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUIObjInfoA { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUIObjInfoA { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleUIObjInfoA_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, lpdwobjsize: *mut u32, lplpszlabel: *mut super::super::Foundation::PSTR, lplpsztype: *mut super::super::Foundation::PSTR, lplpszshorttype: *mut super::super::Foundation::PSTR, lplpszlocation: *mut super::super::Foundation::PSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, lpclassid: *mut ::windows::core::GUID, lpwformat: *mut u16, lpconvertdefaultclassid: *mut ::windows::core::GUID, lplpclsidexclude: *mut *mut ::windows::core::GUID, lpcclsidexclude: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, clsidnew: *const ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, phmetapict: *const isize, pdvaspect: *const u32, pncurrentscale: *const i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, hmetapict: isize, dvaspect: u32, ncurrentscale: i32, brelativetoorig: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUIObjInfoW(pub ::windows::core::IUnknown); impl IOleUIObjInfoW { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetObjectInfo(&self, dwobject: u32, lpdwobjsize: *mut u32, lplpszlabel: *mut super::super::Foundation::PWSTR, lplpsztype: *mut super::super::Foundation::PWSTR, lplpszshorttype: *mut super::super::Foundation::PWSTR, lplpszlocation: *mut super::super::Foundation::PWSTR) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(lpdwobjsize), ::core::mem::transmute(lplpszlabel), ::core::mem::transmute(lplpsztype), ::core::mem::transmute(lplpszshorttype), ::core::mem::transmute(lplpszlocation)).ok() } pub unsafe fn GetConvertInfo(&self, dwobject: u32, lpclassid: *mut ::windows::core::GUID, lpwformat: *mut u16, lpconvertdefaultclassid: *mut ::windows::core::GUID, lplpclsidexclude: *mut *mut ::windows::core::GUID, lpcclsidexclude: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(lpclassid), ::core::mem::transmute(lpwformat), ::core::mem::transmute(lpconvertdefaultclassid), ::core::mem::transmute(lplpclsidexclude), ::core::mem::transmute(lpcclsidexclude)).ok() } pub unsafe fn ConvertObject(&self, dwobject: u32, clsidnew: *const ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(clsidnew)).ok() } pub unsafe fn GetViewInfo(&self, dwobject: u32, phmetapict: *const isize, pdvaspect: *const u32, pncurrentscale: *const i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(phmetapict), ::core::mem::transmute(pdvaspect), ::core::mem::transmute(pncurrentscale)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetViewInfo<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, dwobject: u32, hmetapict: isize, dvaspect: u32, ncurrentscale: i32, brelativetoorig: Param4) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwobject), ::core::mem::transmute(hmetapict), ::core::mem::transmute(dvaspect), ::core::mem::transmute(ncurrentscale), brelativetoorig.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleUIObjInfoW { type Vtable = IOleUIObjInfoW_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::zeroed(); } impl ::core::convert::From<IOleUIObjInfoW> for ::windows::core::IUnknown { fn from(value: IOleUIObjInfoW) -> Self { value.0 } } impl ::core::convert::From<&IOleUIObjInfoW> for ::windows::core::IUnknown { fn from(value: &IOleUIObjInfoW) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUIObjInfoW { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUIObjInfoW { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleUIObjInfoW_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, lpdwobjsize: *mut u32, lplpszlabel: *mut super::super::Foundation::PWSTR, lplpsztype: *mut super::super::Foundation::PWSTR, lplpszshorttype: *mut super::super::Foundation::PWSTR, lplpszlocation: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, lpclassid: *mut ::windows::core::GUID, lpwformat: *mut u16, lpconvertdefaultclassid: *mut ::windows::core::GUID, lplpclsidexclude: *mut *mut ::windows::core::GUID, lpcclsidexclude: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, clsidnew: *const ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, phmetapict: *const isize, pdvaspect: *const u32, pncurrentscale: *const i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwobject: u32, hmetapict: isize, dvaspect: u32, ncurrentscale: i32, brelativetoorig: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUndoManager(pub ::windows::core::IUnknown); impl IOleUndoManager { pub unsafe fn Open<'a, Param0: ::windows::core::IntoParam<'a, IOleParentUndoUnit>>(&self, ppuu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ppuu.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Close<'a, Param0: ::windows::core::IntoParam<'a, IOleParentUndoUnit>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ppuu: Param0, fcommit: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ppuu.into_param().abi(), fcommit.into_param().abi()).ok() } pub unsafe fn Add<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoUnit>>(&self, puu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), puu.into_param().abi()).ok() } pub unsafe fn GetOpenParentState(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } pub unsafe fn DiscardFrom<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoUnit>>(&self, puu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), puu.into_param().abi()).ok() } pub unsafe fn UndoTo<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoUnit>>(&self, puu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), puu.into_param().abi()).ok() } pub unsafe fn RedoTo<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoUnit>>(&self, puu: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), puu.into_param().abi()).ok() } pub unsafe fn EnumUndoable(&self) -> ::windows::core::Result<IEnumOleUndoUnits> { let mut result__: <IEnumOleUndoUnits as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IEnumOleUndoUnits>(result__) } pub unsafe fn EnumRedoable(&self) -> ::windows::core::Result<IEnumOleUndoUnits> { let mut result__: <IEnumOleUndoUnits as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IEnumOleUndoUnits>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLastUndoDescription(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetLastRedoDescription(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Enable<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fenable: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fenable.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleUndoManager { type Vtable = IOleUndoManager_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd001f200_ef97_11ce_9bc9_00aa00608e01); } impl ::core::convert::From<IOleUndoManager> for ::windows::core::IUnknown { fn from(value: IOleUndoManager) -> Self { value.0 } } impl ::core::convert::From<&IOleUndoManager> for ::windows::core::IUnknown { fn from(value: &IOleUndoManager) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUndoManager { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUndoManager { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleUndoManager_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppuu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppuu: ::windows::core::RawPtr, fcommit: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, puu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwstate: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, puu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, puu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, puu: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstr: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstr: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fenable: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleUndoUnit(pub ::windows::core::IUnknown); impl IOleUndoUnit { pub unsafe fn Do<'a, Param0: ::windows::core::IntoParam<'a, IOleUndoManager>>(&self, pundomanager: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pundomanager.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetDescription(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } pub unsafe fn GetUnitType(&self, pclsid: *mut ::windows::core::GUID, plid: *mut i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(pclsid), ::core::mem::transmute(plid)).ok() } pub unsafe fn OnNextAdd(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IOleUndoUnit { type Vtable = IOleUndoUnit_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x894ad3b0_ef97_11ce_9bc9_00aa00608e01); } impl ::core::convert::From<IOleUndoUnit> for ::windows::core::IUnknown { fn from(value: IOleUndoUnit) -> Self { value.0 } } impl ::core::convert::From<&IOleUndoUnit> for ::windows::core::IUnknown { fn from(value: &IOleUndoUnit) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleUndoUnit { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleUndoUnit { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleUndoUnit_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pundomanager: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstr: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclsid: *mut ::windows::core::GUID, plid: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IOleWindow(pub ::windows::core::IUnknown); impl IOleWindow { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetWindow(&self) -> ::windows::core::Result<super::super::Foundation::HWND> { let mut result__: <super::super::Foundation::HWND as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::HWND>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn ContextSensitiveHelp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fentermode: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fentermode.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IOleWindow { type Vtable = IOleWindow_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000114_0000_0000_c000_000000000046); } impl ::core::convert::From<IOleWindow> for ::windows::core::IUnknown { fn from(value: IOleWindow) -> Self { value.0 } } impl ::core::convert::From<&IOleWindow> for ::windows::core::IUnknown { fn from(value: &IOleWindow) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IOleWindow { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IOleWindow { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IOleWindow_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phwnd: *mut super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fentermode: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IParseDisplayName(pub ::windows::core::IUnknown); impl IParseDisplayName { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn ParseDisplayName<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IBindCtx>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pbc: Param0, pszdisplayname: Param1, pcheaten: *mut u32, ppmkout: *mut ::core::option::Option<super::Com::IMoniker>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), pbc.into_param().abi(), pszdisplayname.into_param().abi(), ::core::mem::transmute(pcheaten), ::core::mem::transmute(ppmkout)).ok() } } unsafe impl ::windows::core::Interface for IParseDisplayName { type Vtable = IParseDisplayName_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000011a_0000_0000_c000_000000000046); } impl ::core::convert::From<IParseDisplayName> for ::windows::core::IUnknown { fn from(value: IParseDisplayName) -> Self { value.0 } } impl ::core::convert::From<&IParseDisplayName> for ::windows::core::IUnknown { fn from(value: &IParseDisplayName) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IParseDisplayName { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IParseDisplayName { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IParseDisplayName_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbc: ::windows::core::RawPtr, pszdisplayname: super::super::Foundation::PWSTR, pcheaten: *mut u32, ppmkout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPerPropertyBrowsing(pub ::windows::core::IUnknown); impl IPerPropertyBrowsing { #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetDisplayString(&self, dispid: i32) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } pub unsafe fn MapPropertyToPage(&self, dispid: i32) -> ::windows::core::Result<::windows::core::GUID> { let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid), &mut result__).from_abi::<::windows::core::GUID>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetPredefinedStrings(&self, dispid: i32, pcastringsout: *mut CALPOLESTR, pcacookiesout: *mut CADWORD) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid), ::core::mem::transmute(pcastringsout), ::core::mem::transmute(pcacookiesout)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn GetPredefinedValue(&self, dispid: i32, dwcookie: u32) -> ::windows::core::Result<super::Com::VARIANT> { let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid), ::core::mem::transmute(dwcookie), &mut result__).from_abi::<super::Com::VARIANT>(result__) } } unsafe impl ::windows::core::Interface for IPerPropertyBrowsing { type Vtable = IPerPropertyBrowsing_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x376bd3aa_3845_101b_84ed_08002b2ec713); } impl ::core::convert::From<IPerPropertyBrowsing> for ::windows::core::IUnknown { fn from(value: IPerPropertyBrowsing) -> Self { value.0 } } impl ::core::convert::From<&IPerPropertyBrowsing> for ::windows::core::IUnknown { fn from(value: &IPerPropertyBrowsing) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPerPropertyBrowsing { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPerPropertyBrowsing { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPerPropertyBrowsing_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32, pbstr: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32, pclsid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32, pcastringsout: *mut CALPOLESTR, pcacookiesout: *mut CADWORD) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32, dwcookie: u32, pvarout: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPersistPropertyBag(pub ::windows::core::IUnknown); impl IPersistPropertyBag { pub unsafe fn GetClassID(&self) -> ::windows::core::Result<::windows::core::GUID> { let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::GUID>(result__) } pub unsafe fn InitNew(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn Load<'a, Param0: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IPropertyBag>, Param1: ::windows::core::IntoParam<'a, super::Com::IErrorLog>>(&self, ppropbag: Param0, perrorlog: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ppropbag.into_param().abi(), perrorlog.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn Save<'a, Param0: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IPropertyBag>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ppropbag: Param0, fcleardirty: Param1, fsaveallproperties: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ppropbag.into_param().abi(), fcleardirty.into_param().abi(), fsaveallproperties.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IPersistPropertyBag { type Vtable = IPersistPropertyBag_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x37d84f60_42cb_11ce_8135_00aa004bb851); } impl ::core::convert::From<IPersistPropertyBag> for ::windows::core::IUnknown { fn from(value: IPersistPropertyBag) -> Self { value.0 } } impl ::core::convert::From<&IPersistPropertyBag> for ::windows::core::IUnknown { fn from(value: &IPersistPropertyBag) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPersistPropertyBag { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPersistPropertyBag { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IPersistPropertyBag> for super::Com::IPersist { fn from(value: IPersistPropertyBag) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IPersistPropertyBag> for super::Com::IPersist { fn from(value: &IPersistPropertyBag) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IPersist> for IPersistPropertyBag { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IPersist> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IPersist> for &IPersistPropertyBag { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IPersist> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IPersistPropertyBag_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclassid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppropbag: ::windows::core::RawPtr, perrorlog: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppropbag: ::windows::core::RawPtr, fcleardirty: super::super::Foundation::BOOL, fsaveallproperties: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com_StructuredStorage")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPersistPropertyBag2(pub ::windows::core::IUnknown); impl IPersistPropertyBag2 { pub unsafe fn GetClassID(&self) -> ::windows::core::Result<::windows::core::GUID> { let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::GUID>(result__) } pub unsafe fn InitNew(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn Load<'a, Param0: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IPropertyBag2>, Param1: ::windows::core::IntoParam<'a, super::Com::IErrorLog>>(&self, ppropbag: Param0, perrlog: Param1) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ppropbag.into_param().abi(), perrlog.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn Save<'a, Param0: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IPropertyBag2>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ppropbag: Param0, fcleardirty: Param1, fsaveallproperties: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ppropbag.into_param().abi(), fcleardirty.into_param().abi(), fsaveallproperties.into_param().abi()).ok() } pub unsafe fn IsDirty(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)).ok() } } unsafe impl ::windows::core::Interface for IPersistPropertyBag2 { type Vtable = IPersistPropertyBag2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x22f55881_280b_11d0_a8a9_00a0c90c2004); } impl ::core::convert::From<IPersistPropertyBag2> for ::windows::core::IUnknown { fn from(value: IPersistPropertyBag2) -> Self { value.0 } } impl ::core::convert::From<&IPersistPropertyBag2> for ::windows::core::IUnknown { fn from(value: &IPersistPropertyBag2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPersistPropertyBag2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPersistPropertyBag2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IPersistPropertyBag2> for super::Com::IPersist { fn from(value: IPersistPropertyBag2) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IPersistPropertyBag2> for super::Com::IPersist { fn from(value: &IPersistPropertyBag2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IPersist> for IPersistPropertyBag2 { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IPersist> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IPersist> for &IPersistPropertyBag2 { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IPersist> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IPersistPropertyBag2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclassid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppropbag: ::windows::core::RawPtr, perrlog: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppropbag: ::windows::core::RawPtr, fcleardirty: super::super::Foundation::BOOL, fsaveallproperties: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com_StructuredStorage")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPicture(pub ::windows::core::IUnknown); impl IPicture { pub unsafe fn Handle(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } pub unsafe fn hPal(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } pub unsafe fn Type(&self) -> ::windows::core::Result<i16> { let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i16>(result__) } pub unsafe fn Width(&self) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i32>(result__) } pub unsafe fn Height(&self) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i32>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe fn Render<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, hdc: Param0, x: i32, y: i32, cx: i32, cy: i32, xsrc: i32, ysrc: i32, cxsrc: i32, cysrc: i32, prcwbounds: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)( ::core::mem::transmute_copy(self), hdc.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y), ::core::mem::transmute(cx), ::core::mem::transmute(cy), ::core::mem::transmute(xsrc), ::core::mem::transmute(ysrc), ::core::mem::transmute(cxsrc), ::core::mem::transmute(cysrc), ::core::mem::transmute(prcwbounds), ) .ok() } pub unsafe fn set_hPal(&self, hpal: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(hpal)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn CurDC(&self) -> ::windows::core::Result<super::super::Graphics::Gdi::HDC> { let mut result__: <super::super::Graphics::Gdi::HDC as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Graphics::Gdi::HDC>(result__) } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn SelectPicture<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, hdcin: Param0, phdcout: *mut super::super::Graphics::Gdi::HDC, phbmpout: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), hdcin.into_param().abi(), ::core::mem::transmute(phdcout), ::core::mem::transmute(phbmpout)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn KeepOriginalFormat(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetKeepOriginalFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, keep: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), keep.into_param().abi()).ok() } pub unsafe fn PictureChanged(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SaveAsFile<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pstream: Param0, fsavememcopy: Param1) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), pstream.into_param().abi(), fsavememcopy.into_param().abi(), &mut result__).from_abi::<i32>(result__) } pub unsafe fn Attributes(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } } unsafe impl ::windows::core::Interface for IPicture { type Vtable = IPicture_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7bf80980_bf32_101a_8bbb_00aa00300cab); } impl ::core::convert::From<IPicture> for ::windows::core::IUnknown { fn from(value: IPicture) -> Self { value.0 } } impl ::core::convert::From<&IPicture> for ::windows::core::IUnknown { fn from(value: &IPicture) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPicture { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPicture { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPicture_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phandle: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phpal: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptype: *mut i16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pwidth: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pheight: *mut i32) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::super::Graphics::Gdi::HDC, x: i32, y: i32, cx: i32, cy: i32, xsrc: i32, ysrc: i32, cxsrc: i32, cysrc: i32, prcwbounds: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hpal: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phdc: *mut super::super::Graphics::Gdi::HDC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdcin: super::super::Graphics::Gdi::HDC, phdcout: *mut super::super::Graphics::Gdi::HDC, phbmpout: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pkeep: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, keep: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstream: ::windows::core::RawPtr, fsavememcopy: super::super::Foundation::BOOL, pcbsize: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwattr: *mut u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPicture2(pub ::windows::core::IUnknown); impl IPicture2 { pub unsafe fn Handle(&self) -> ::windows::core::Result<usize> { let mut result__: <usize as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<usize>(result__) } pub unsafe fn hPal(&self) -> ::windows::core::Result<usize> { let mut result__: <usize as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<usize>(result__) } pub unsafe fn Type(&self) -> ::windows::core::Result<i16> { let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i16>(result__) } pub unsafe fn Width(&self) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i32>(result__) } pub unsafe fn Height(&self) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i32>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe fn Render<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, hdc: Param0, x: i32, y: i32, cx: i32, cy: i32, xsrc: i32, ysrc: i32, cxsrc: i32, cysrc: i32, prcwbounds: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)( ::core::mem::transmute_copy(self), hdc.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y), ::core::mem::transmute(cx), ::core::mem::transmute(cy), ::core::mem::transmute(xsrc), ::core::mem::transmute(ysrc), ::core::mem::transmute(cxsrc), ::core::mem::transmute(cysrc), ::core::mem::transmute(prcwbounds), ) .ok() } pub unsafe fn set_hPal(&self, hpal: usize) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(hpal)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn CurDC(&self) -> ::windows::core::Result<super::super::Graphics::Gdi::HDC> { let mut result__: <super::super::Graphics::Gdi::HDC as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Graphics::Gdi::HDC>(result__) } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn SelectPicture<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, hdcin: Param0, phdcout: *mut super::super::Graphics::Gdi::HDC, phbmpout: *mut usize) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), hdcin.into_param().abi(), ::core::mem::transmute(phdcout), ::core::mem::transmute(phbmpout)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn KeepOriginalFormat(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetKeepOriginalFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, keep: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), keep.into_param().abi()).ok() } pub unsafe fn PictureChanged(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn SaveAsFile<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pstream: Param0, fsavememcopy: Param1) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), pstream.into_param().abi(), fsavememcopy.into_param().abi(), &mut result__).from_abi::<i32>(result__) } pub unsafe fn Attributes(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } } unsafe impl ::windows::core::Interface for IPicture2 { type Vtable = IPicture2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf5185dd8_2012_4b0b_aad9_f052c6bd482b); } impl ::core::convert::From<IPicture2> for ::windows::core::IUnknown { fn from(value: IPicture2) -> Self { value.0 } } impl ::core::convert::From<&IPicture2> for ::windows::core::IUnknown { fn from(value: &IPicture2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPicture2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPicture2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPicture2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phandle: *mut usize) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phpal: *mut usize) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptype: *mut i16) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pwidth: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pheight: *mut i32) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::super::Graphics::Gdi::HDC, x: i32, y: i32, cx: i32, cy: i32, xsrc: i32, ysrc: i32, cxsrc: i32, cysrc: i32, prcwbounds: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hpal: usize) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phdc: *mut super::super::Graphics::Gdi::HDC) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdcin: super::super::Graphics::Gdi::HDC, phdcout: *mut super::super::Graphics::Gdi::HDC, phbmpout: *mut usize) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pkeep: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, keep: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pstream: ::windows::core::RawPtr, fsavememcopy: super::super::Foundation::BOOL, pcbsize: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwattr: *mut u32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPictureDisp(pub ::windows::core::IUnknown); impl IPictureDisp {} unsafe impl ::windows::core::Interface for IPictureDisp { type Vtable = IPictureDisp_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7bf80981_bf32_101a_8bbb_00aa00300cab); } impl ::core::convert::From<IPictureDisp> for ::windows::core::IUnknown { fn from(value: IPictureDisp) -> Self { value.0 } } impl ::core::convert::From<&IPictureDisp> for ::windows::core::IUnknown { fn from(value: &IPictureDisp) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPictureDisp { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPictureDisp { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<IPictureDisp> for super::Com::IDispatch { fn from(value: IPictureDisp) -> Self { unsafe { ::core::mem::transmute(value) } } } #[cfg(feature = "Win32_System_Com")] impl ::core::convert::From<&IPictureDisp> for super::Com::IDispatch { fn from(value: &IPictureDisp) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for IPictureDisp { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } #[cfg(feature = "Win32_System_Com")] impl<'a> ::windows::core::IntoParam<'a, super::Com::IDispatch> for &IPictureDisp { fn into_param(self) -> ::windows::core::Param<'a, super::Com::IDispatch> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IPictureDisp_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pctinfo: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, itinfo: u32, lcid: u32, pptinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, rgsznames: *const super::super::Foundation::PWSTR, cnames: u32, lcid: u32, rgdispid: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispidmember: i32, riid: *const ::windows::core::GUID, lcid: u32, wflags: u16, pdispparams: *const super::Com::DISPPARAMS, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pexcepinfo: *mut ::core::mem::ManuallyDrop<super::Com::EXCEPINFO>, puargerr: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPointerInactive(pub ::windows::core::IUnknown); impl IPointerInactive { pub unsafe fn GetActivationPolicy(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnInactiveMouseMove(&self, prectbounds: *const super::super::Foundation::RECT, x: i32, y: i32, grfkeystate: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(prectbounds), ::core::mem::transmute(x), ::core::mem::transmute(y), ::core::mem::transmute(grfkeystate)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn OnInactiveSetCursor<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, prectbounds: *const super::super::Foundation::RECT, x: i32, y: i32, dwmousemsg: u32, fsetalways: Param4) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(prectbounds), ::core::mem::transmute(x), ::core::mem::transmute(y), ::core::mem::transmute(dwmousemsg), fsetalways.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for IPointerInactive { type Vtable = IPointerInactive_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x55980ba0_35aa_11cf_b671_00aa004cd6d8); } impl ::core::convert::From<IPointerInactive> for ::windows::core::IUnknown { fn from(value: IPointerInactive) -> Self { value.0 } } impl ::core::convert::From<&IPointerInactive> for ::windows::core::IUnknown { fn from(value: &IPointerInactive) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPointerInactive { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPointerInactive { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPointerInactive_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwpolicy: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prectbounds: *const super::super::Foundation::RECT, x: i32, y: i32, grfkeystate: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prectbounds: *const super::super::Foundation::RECT, x: i32, y: i32, dwmousemsg: u32, fsetalways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPrint(pub ::windows::core::IUnknown); impl IPrint { pub unsafe fn SetInitialPageNum(&self, nfirstpage: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(nfirstpage)).ok() } pub unsafe fn GetPageInfo(&self, pnfirstpage: *mut i32, pcpages: *mut i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(pnfirstpage), ::core::mem::transmute(pcpages)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe fn Print<'a, Param4: ::windows::core::IntoParam<'a, IContinueCallback>>(&self, grfflags: u32, pptd: *mut *mut super::Com::DVTARGETDEVICE, pppageset: *mut *mut PAGESET, pstgmoptions: *mut super::Com::STGMEDIUM, pcallback: Param4, nfirstpage: i32, pcpagesprinted: *mut i32, pnlastpage: *mut i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)( ::core::mem::transmute_copy(self), ::core::mem::transmute(grfflags), ::core::mem::transmute(pptd), ::core::mem::transmute(pppageset), ::core::mem::transmute(pstgmoptions), pcallback.into_param().abi(), ::core::mem::transmute(nfirstpage), ::core::mem::transmute(pcpagesprinted), ::core::mem::transmute(pnlastpage), ) .ok() } } unsafe impl ::windows::core::Interface for IPrint { type Vtable = IPrint_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb722bcc9_4e68_101b_a2bc_00aa00404770); } impl ::core::convert::From<IPrint> for ::windows::core::IUnknown { fn from(value: IPrint) -> Self { value.0 } } impl ::core::convert::From<&IPrint> for ::windows::core::IUnknown { fn from(value: &IPrint) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPrint { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPrint { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPrint_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, nfirstpage: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pnfirstpage: *mut i32, pcpages: *mut i32) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, grfflags: u32, pptd: *mut *mut super::Com::DVTARGETDEVICE, pppageset: *mut *mut PAGESET, pstgmoptions: *mut ::core::mem::ManuallyDrop<super::Com::STGMEDIUM>, pcallback: ::windows::core::RawPtr, nfirstpage: i32, pcpagesprinted: *mut i32, pnlastpage: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPropertyNotifySink(pub ::windows::core::IUnknown); impl IPropertyNotifySink { pub unsafe fn OnChanged(&self, dispid: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid)).ok() } pub unsafe fn OnRequestEdit(&self, dispid: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid)).ok() } } unsafe impl ::windows::core::Interface for IPropertyNotifySink { type Vtable = IPropertyNotifySink_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9bfbbc02_eff1_101a_84ed_00aa00341d07); } impl ::core::convert::From<IPropertyNotifySink> for ::windows::core::IUnknown { fn from(value: IPropertyNotifySink) -> Self { value.0 } } impl ::core::convert::From<&IPropertyNotifySink> for ::windows::core::IUnknown { fn from(value: &IPropertyNotifySink) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPropertyNotifySink { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPropertyNotifySink { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPropertyNotifySink_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPropertyPage(pub ::windows::core::IUnknown); impl IPropertyPage { pub unsafe fn SetPageSite<'a, Param0: ::windows::core::IntoParam<'a, IPropertyPageSite>>(&self, ppagesite: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ppagesite.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Activate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, hwndparent: Param0, prect: *const super::super::Foundation::RECT, bmodal: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), hwndparent.into_param().abi(), ::core::mem::transmute(prect), bmodal.into_param().abi()).ok() } pub unsafe fn Deactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetPageInfo(&self) -> ::windows::core::Result<PROPPAGEINFO> { let mut result__: <PROPPAGEINFO as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<PROPPAGEINFO>(result__) } pub unsafe fn SetObjects(&self, cobjects: u32, ppunk: *const ::core::option::Option<::windows::core::IUnknown>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(cobjects), ::core::mem::transmute(ppunk)).ok() } pub unsafe fn Show(&self, ncmdshow: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(ncmdshow)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Move(&self, prect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(prect)).ok() } pub unsafe fn IsPageDirty(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn Apply(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Help<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pszhelpdir: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), pszhelpdir.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn TranslateAccelerator(&self, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(pmsg)).ok() } } unsafe impl ::windows::core::Interface for IPropertyPage { type Vtable = IPropertyPage_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb196b28d_bab4_101a_b69c_00aa00341d07); } impl ::core::convert::From<IPropertyPage> for ::windows::core::IUnknown { fn from(value: IPropertyPage) -> Self { value.0 } } impl ::core::convert::From<&IPropertyPage> for ::windows::core::IUnknown { fn from(value: &IPropertyPage) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPropertyPage { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPropertyPage { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPropertyPage_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppagesite: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hwndparent: super::super::Foundation::HWND, prect: *const super::super::Foundation::RECT, bmodal: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppageinfo: *mut PROPPAGEINFO) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cobjects: u32, ppunk: *const ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ncmdshow: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszhelpdir: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPropertyPage2(pub ::windows::core::IUnknown); impl IPropertyPage2 { pub unsafe fn SetPageSite<'a, Param0: ::windows::core::IntoParam<'a, IPropertyPageSite>>(&self, ppagesite: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ppagesite.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Activate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, hwndparent: Param0, prect: *const super::super::Foundation::RECT, bmodal: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), hwndparent.into_param().abi(), ::core::mem::transmute(prect), bmodal.into_param().abi()).ok() } pub unsafe fn Deactivate(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetPageInfo(&self) -> ::windows::core::Result<PROPPAGEINFO> { let mut result__: <PROPPAGEINFO as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<PROPPAGEINFO>(result__) } pub unsafe fn SetObjects(&self, cobjects: u32, ppunk: *const ::core::option::Option<::windows::core::IUnknown>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(cobjects), ::core::mem::transmute(ppunk)).ok() } pub unsafe fn Show(&self, ncmdshow: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(ncmdshow)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Move(&self, prect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(prect)).ok() } pub unsafe fn IsPageDirty(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)).ok() } pub unsafe fn Apply(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn Help<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pszhelpdir: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), pszhelpdir.into_param().abi()).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn TranslateAccelerator(&self, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(pmsg)).ok() } pub unsafe fn EditProperty(&self, dispid: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(dispid)).ok() } } unsafe impl ::windows::core::Interface for IPropertyPage2 { type Vtable = IPropertyPage2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x01e44665_24ac_101b_84ed_08002b2ec713); } impl ::core::convert::From<IPropertyPage2> for ::windows::core::IUnknown { fn from(value: IPropertyPage2) -> Self { value.0 } } impl ::core::convert::From<&IPropertyPage2> for ::windows::core::IUnknown { fn from(value: &IPropertyPage2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPropertyPage2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPropertyPage2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IPropertyPage2> for IPropertyPage { fn from(value: IPropertyPage2) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IPropertyPage2> for IPropertyPage { fn from(value: &IPropertyPage2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IPropertyPage> for IPropertyPage2 { fn into_param(self) -> ::windows::core::Param<'a, IPropertyPage> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IPropertyPage> for &IPropertyPage2 { fn into_param(self) -> ::windows::core::Param<'a, IPropertyPage> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IPropertyPage2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppagesite: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hwndparent: super::super::Foundation::HWND, prect: *const super::super::Foundation::RECT, bmodal: super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppageinfo: *mut PROPPAGEINFO) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cobjects: u32, ppunk: *const ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ncmdshow: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszhelpdir: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dispid: i32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IPropertyPageSite(pub ::windows::core::IUnknown); impl IPropertyPageSite { pub unsafe fn OnStatusChange(&self, dwflags: PROPPAGESTATUS) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwflags)).ok() } pub unsafe fn GetLocaleID(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } pub unsafe fn GetPageContainer(&self) -> ::windows::core::Result<::windows::core::IUnknown> { let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn TranslateAccelerator(&self, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(pmsg)).ok() } } unsafe impl ::windows::core::Interface for IPropertyPageSite { type Vtable = IPropertyPageSite_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb196b28c_bab4_101a_b69c_00aa00341d07); } impl ::core::convert::From<IPropertyPageSite> for ::windows::core::IUnknown { fn from(value: IPropertyPageSite) -> Self { value.0 } } impl ::core::convert::From<&IPropertyPageSite> for ::windows::core::IUnknown { fn from(value: &IPropertyPageSite) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IPropertyPageSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IPropertyPageSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IPropertyPageSite_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwflags: PROPPAGESTATUS) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, plocaleid: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppunk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pmsg: *const super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IProtectFocus(pub ::windows::core::IUnknown); impl IProtectFocus { #[cfg(feature = "Win32_Foundation")] pub unsafe fn AllowFocusChange(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> { let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } } unsafe impl ::windows::core::Interface for IProtectFocus { type Vtable = IProtectFocus_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd81f90a3_8156_44f7_ad28_5abb87003274); } impl ::core::convert::From<IProtectFocus> for ::windows::core::IUnknown { fn from(value: IProtectFocus) -> Self { value.0 } } impl ::core::convert::From<&IProtectFocus> for ::windows::core::IUnknown { fn from(value: &IProtectFocus) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IProtectFocus { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IProtectFocus { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IProtectFocus_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pfallow: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IProtectedModeMenuServices(pub ::windows::core::IUnknown); impl IProtectedModeMenuServices { #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn CreateMenu(&self) -> ::windows::core::Result<super::super::UI::WindowsAndMessaging::HMENU> { let mut result__: <super::super::UI::WindowsAndMessaging::HMENU as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::UI::WindowsAndMessaging::HMENU>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn LoadMenu<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pszmodulename: Param0, pszmenuname: Param1) -> ::windows::core::Result<super::super::UI::WindowsAndMessaging::HMENU> { let mut result__: <super::super::UI::WindowsAndMessaging::HMENU as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), pszmodulename.into_param().abi(), pszmenuname.into_param().abi(), &mut result__).from_abi::<super::super::UI::WindowsAndMessaging::HMENU>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe fn LoadMenuID<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pszmodulename: Param0, wresourceid: u16) -> ::windows::core::Result<super::super::UI::WindowsAndMessaging::HMENU> { let mut result__: <super::super::UI::WindowsAndMessaging::HMENU as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), pszmodulename.into_param().abi(), ::core::mem::transmute(wresourceid), &mut result__).from_abi::<super::super::UI::WindowsAndMessaging::HMENU>(result__) } } unsafe impl ::windows::core::Interface for IProtectedModeMenuServices { type Vtable = IProtectedModeMenuServices_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x73c105ee_9dff_4a07_b83c_7eff290c266e); } impl ::core::convert::From<IProtectedModeMenuServices> for ::windows::core::IUnknown { fn from(value: IProtectedModeMenuServices) -> Self { value.0 } } impl ::core::convert::From<&IProtectedModeMenuServices> for ::windows::core::IUnknown { fn from(value: &IProtectedModeMenuServices) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IProtectedModeMenuServices { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IProtectedModeMenuServices { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IProtectedModeMenuServices_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, phmenu: *mut super::super::UI::WindowsAndMessaging::HMENU) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszmodulename: super::super::Foundation::PWSTR, pszmenuname: super::super::Foundation::PWSTR, phmenu: *mut super::super::UI::WindowsAndMessaging::HMENU) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pszmodulename: super::super::Foundation::PWSTR, wresourceid: u16, phmenu: *mut super::super::UI::WindowsAndMessaging::HMENU) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IProvideClassInfo(pub ::windows::core::IUnknown); impl IProvideClassInfo { #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetClassInfo(&self) -> ::windows::core::Result<super::Com::ITypeInfo> { let mut result__: <super::Com::ITypeInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::ITypeInfo>(result__) } } unsafe impl ::windows::core::Interface for IProvideClassInfo { type Vtable = IProvideClassInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb196b283_bab4_101a_b69c_00aa00341d07); } impl ::core::convert::From<IProvideClassInfo> for ::windows::core::IUnknown { fn from(value: IProvideClassInfo) -> Self { value.0 } } impl ::core::convert::From<&IProvideClassInfo> for ::windows::core::IUnknown { fn from(value: &IProvideClassInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IProvideClassInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IProvideClassInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IProvideClassInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppti: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IProvideClassInfo2(pub ::windows::core::IUnknown); impl IProvideClassInfo2 { #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetClassInfo(&self) -> ::windows::core::Result<super::Com::ITypeInfo> { let mut result__: <super::Com::ITypeInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::ITypeInfo>(result__) } pub unsafe fn GetGUID(&self, dwguidkind: u32) -> ::windows::core::Result<::windows::core::GUID> { let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwguidkind), &mut result__).from_abi::<::windows::core::GUID>(result__) } } unsafe impl ::windows::core::Interface for IProvideClassInfo2 { type Vtable = IProvideClassInfo2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa6bc3ac0_dbaa_11ce_9de3_00aa004bb851); } impl ::core::convert::From<IProvideClassInfo2> for ::windows::core::IUnknown { fn from(value: IProvideClassInfo2) -> Self { value.0 } } impl ::core::convert::From<&IProvideClassInfo2> for ::windows::core::IUnknown { fn from(value: &IProvideClassInfo2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IProvideClassInfo2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IProvideClassInfo2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IProvideClassInfo2> for IProvideClassInfo { fn from(value: IProvideClassInfo2) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IProvideClassInfo2> for IProvideClassInfo { fn from(value: &IProvideClassInfo2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IProvideClassInfo> for IProvideClassInfo2 { fn into_param(self) -> ::windows::core::Param<'a, IProvideClassInfo> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IProvideClassInfo> for &IProvideClassInfo2 { fn into_param(self) -> ::windows::core::Param<'a, IProvideClassInfo> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IProvideClassInfo2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppti: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwguidkind: u32, pguid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IProvideMultipleClassInfo(pub ::windows::core::IUnknown); impl IProvideMultipleClassInfo { #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetClassInfo(&self) -> ::windows::core::Result<super::Com::ITypeInfo> { let mut result__: <super::Com::ITypeInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::ITypeInfo>(result__) } pub unsafe fn GetGUID(&self, dwguidkind: u32) -> ::windows::core::Result<::windows::core::GUID> { let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwguidkind), &mut result__).from_abi::<::windows::core::GUID>(result__) } pub unsafe fn GetMultiTypeInfoCount(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetInfoOfIndex(&self, iti: u32, dwflags: MULTICLASSINFO_FLAGS, ppticoclass: *mut ::core::option::Option<super::Com::ITypeInfo>, pdwtiflags: *mut u32, pcdispidreserved: *mut u32, piidprimary: *mut ::windows::core::GUID, piidsource: *mut ::windows::core::GUID) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(iti), ::core::mem::transmute(dwflags), ::core::mem::transmute(ppticoclass), ::core::mem::transmute(pdwtiflags), ::core::mem::transmute(pcdispidreserved), ::core::mem::transmute(piidprimary), ::core::mem::transmute(piidsource)).ok() } } unsafe impl ::windows::core::Interface for IProvideMultipleClassInfo { type Vtable = IProvideMultipleClassInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa7aba9c1_8983_11cf_8f20_00805f2cd064); } impl ::core::convert::From<IProvideMultipleClassInfo> for ::windows::core::IUnknown { fn from(value: IProvideMultipleClassInfo) -> Self { value.0 } } impl ::core::convert::From<&IProvideMultipleClassInfo> for ::windows::core::IUnknown { fn from(value: &IProvideMultipleClassInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IProvideMultipleClassInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IProvideMultipleClassInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IProvideMultipleClassInfo> for IProvideClassInfo2 { fn from(value: IProvideMultipleClassInfo) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IProvideMultipleClassInfo> for IProvideClassInfo2 { fn from(value: &IProvideMultipleClassInfo) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IProvideClassInfo2> for IProvideMultipleClassInfo { fn into_param(self) -> ::windows::core::Param<'a, IProvideClassInfo2> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IProvideClassInfo2> for &IProvideMultipleClassInfo { fn into_param(self) -> ::windows::core::Param<'a, IProvideClassInfo2> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IProvideMultipleClassInfo> for IProvideClassInfo { fn from(value: IProvideMultipleClassInfo) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IProvideMultipleClassInfo> for IProvideClassInfo { fn from(value: &IProvideMultipleClassInfo) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IProvideClassInfo> for IProvideMultipleClassInfo { fn into_param(self) -> ::windows::core::Param<'a, IProvideClassInfo> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IProvideClassInfo> for &IProvideMultipleClassInfo { fn into_param(self) -> ::windows::core::Param<'a, IProvideClassInfo> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IProvideMultipleClassInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppti: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwguidkind: u32, pguid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pcti: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iti: u32, dwflags: MULTICLASSINFO_FLAGS, ppticoclass: *mut ::windows::core::RawPtr, pdwtiflags: *mut u32, pcdispidreserved: *mut u32, piidprimary: *mut ::windows::core::GUID, piidsource: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IProvideRuntimeContext(pub ::windows::core::IUnknown); impl IProvideRuntimeContext { pub unsafe fn GetCurrentSourceContext(&self, pdwcontext: *mut usize, pfexecutingglobalcode: *mut i16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pdwcontext), ::core::mem::transmute(pfexecutingglobalcode)).ok() } } unsafe impl ::windows::core::Interface for IProvideRuntimeContext { type Vtable = IProvideRuntimeContext_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x10e2414a_ec59_49d2_bc51_5add2c36febc); } impl ::core::convert::From<IProvideRuntimeContext> for ::windows::core::IUnknown { fn from(value: IProvideRuntimeContext) -> Self { value.0 } } impl ::core::convert::From<&IProvideRuntimeContext> for ::windows::core::IUnknown { fn from(value: &IProvideRuntimeContext) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IProvideRuntimeContext { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IProvideRuntimeContext { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IProvideRuntimeContext_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwcontext: *mut usize, pfexecutingglobalcode: *mut i16) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IQuickActivate(pub ::windows::core::IUnknown); impl IQuickActivate { #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn QuickActivate(&self, pqacontainer: *const QACONTAINER, pqacontrol: *mut QACONTROL) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pqacontainer), ::core::mem::transmute(pqacontrol)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn SetContentExtent(&self, psizel: *const super::super::Foundation::SIZE) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(psizel)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetContentExtent(&self) -> ::windows::core::Result<super::super::Foundation::SIZE> { let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__) } } unsafe impl ::windows::core::Interface for IQuickActivate { type Vtable = IQuickActivate_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcf51ed10_62fe_11cf_bf86_00a0c9034836); } impl ::core::convert::From<IQuickActivate> for ::windows::core::IUnknown { fn from(value: IQuickActivate) -> Self { value.0 } } impl ::core::convert::From<&IQuickActivate> for ::windows::core::IUnknown { fn from(value: &IQuickActivate) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IQuickActivate { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IQuickActivate { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IQuickActivate_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pqacontainer: *const ::core::mem::ManuallyDrop<QACONTAINER>, pqacontrol: *mut QACONTROL) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, psizel: *const super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, psizel: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IRecordInfo(pub ::windows::core::IUnknown); impl IRecordInfo { pub unsafe fn RecordInit(&self, pvnew: *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvnew)).ok() } pub unsafe fn RecordClear(&self, pvexisting: *const ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvexisting)).ok() } pub unsafe fn RecordCopy(&self, pvexisting: *const ::core::ffi::c_void, pvnew: *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvexisting), ::core::mem::transmute(pvnew)).ok() } pub unsafe fn GetGuid(&self) -> ::windows::core::Result<::windows::core::GUID> { let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::GUID>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetName(&self) -> ::windows::core::Result<super::super::Foundation::BSTR> { let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } pub unsafe fn GetSize(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetTypeInfo(&self) -> ::windows::core::Result<super::Com::ITypeInfo> { let mut result__: <super::Com::ITypeInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Com::ITypeInfo>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn GetField<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pvdata: *const ::core::ffi::c_void, szfieldname: Param1) -> ::windows::core::Result<super::Com::VARIANT> { let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvdata), szfieldname.into_param().abi(), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn GetFieldNoCopy<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, pvdata: *const ::core::ffi::c_void, szfieldname: Param1, pvarfield: *mut super::Com::VARIANT, ppvdatacarray: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvdata), szfieldname.into_param().abi(), ::core::mem::transmute(pvarfield), ::core::mem::transmute(ppvdatacarray)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn PutField<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, wflags: u32, pvdata: *mut ::core::ffi::c_void, szfieldname: Param2, pvarfield: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(wflags), ::core::mem::transmute(pvdata), szfieldname.into_param().abi(), ::core::mem::transmute(pvarfield)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn PutFieldNoCopy<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, wflags: u32, pvdata: *mut ::core::ffi::c_void, szfieldname: Param2, pvarfield: *const super::Com::VARIANT) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(wflags), ::core::mem::transmute(pvdata), szfieldname.into_param().abi(), ::core::mem::transmute(pvarfield)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetFieldNames(&self, pcnames: *mut u32, rgbstrnames: *mut super::super::Foundation::BSTR) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(pcnames), ::core::mem::transmute(rgbstrnames)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn IsMatchingType<'a, Param0: ::windows::core::IntoParam<'a, IRecordInfo>>(&self, precordinfo: Param0) -> super::super::Foundation::BOOL { ::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), precordinfo.into_param().abi())) } pub unsafe fn RecordCreate(&self) -> *mut ::core::ffi::c_void { ::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self))) } pub unsafe fn RecordCreateCopy(&self, pvsource: *const ::core::ffi::c_void, ppvdest: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvsource), ::core::mem::transmute(ppvdest)).ok() } pub unsafe fn RecordDestroy(&self, pvrecord: *const ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvrecord)).ok() } } unsafe impl ::windows::core::Interface for IRecordInfo { type Vtable = IRecordInfo_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000002f_0000_0000_c000_000000000046); } impl ::core::convert::From<IRecordInfo> for ::windows::core::IUnknown { fn from(value: IRecordInfo) -> Self { value.0 } } impl ::core::convert::From<&IRecordInfo> for ::windows::core::IUnknown { fn from(value: &IRecordInfo) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IRecordInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IRecordInfo { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IRecordInfo_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvnew: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvexisting: *const ::core::ffi::c_void) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvexisting: *const ::core::ffi::c_void, pvnew: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pguid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pbstrname: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pcbsize: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pptypeinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvdata: *const ::core::ffi::c_void, szfieldname: super::super::Foundation::PWSTR, pvarfield: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvdata: *const ::core::ffi::c_void, szfieldname: super::super::Foundation::PWSTR, pvarfield: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, ppvdatacarray: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wflags: u32, pvdata: *mut ::core::ffi::c_void, szfieldname: super::super::Foundation::PWSTR, pvarfield: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wflags: u32, pvdata: *mut ::core::ffi::c_void, szfieldname: super::super::Foundation::PWSTR, pvarfield: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pcnames: *mut u32, rgbstrnames: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, precordinfo: ::windows::core::RawPtr) -> super::super::Foundation::BOOL, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> *mut ::core::ffi::c_void, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvsource: *const ::core::ffi::c_void, ppvdest: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvrecord: *const ::core::ffi::c_void) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ISimpleFrameSite(pub ::windows::core::IUnknown); impl ISimpleFrameSite { #[cfg(feature = "Win32_Foundation")] pub unsafe fn PreMessageFilter<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::WPARAM>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(&self, hwnd: Param0, msg: u32, wp: Param2, lp: Param3, plresult: *mut super::super::Foundation::LRESULT, pdwcookie: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), hwnd.into_param().abi(), ::core::mem::transmute(msg), wp.into_param().abi(), lp.into_param().abi(), ::core::mem::transmute(plresult), ::core::mem::transmute(pdwcookie)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn PostMessageFilter<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::WPARAM>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(&self, hwnd: Param0, msg: u32, wp: Param2, lp: Param3, plresult: *mut super::super::Foundation::LRESULT, dwcookie: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), hwnd.into_param().abi(), ::core::mem::transmute(msg), wp.into_param().abi(), lp.into_param().abi(), ::core::mem::transmute(plresult), ::core::mem::transmute(dwcookie)).ok() } } unsafe impl ::windows::core::Interface for ISimpleFrameSite { type Vtable = ISimpleFrameSite_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x742b0e01_14e6_101b_914e_00aa00300cab); } impl ::core::convert::From<ISimpleFrameSite> for ::windows::core::IUnknown { fn from(value: ISimpleFrameSite) -> Self { value.0 } } impl ::core::convert::From<&ISimpleFrameSite> for ::windows::core::IUnknown { fn from(value: &ISimpleFrameSite) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ISimpleFrameSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ISimpleFrameSite { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ISimpleFrameSite_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hwnd: super::super::Foundation::HWND, msg: u32, wp: super::super::Foundation::WPARAM, lp: super::super::Foundation::LPARAM, plresult: *mut super::super::Foundation::LRESULT, pdwcookie: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hwnd: super::super::Foundation::HWND, msg: u32, wp: super::super::Foundation::WPARAM, lp: super::super::Foundation::LPARAM, plresult: *mut super::super::Foundation::LRESULT, dwcookie: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ISpecifyPropertyPages(pub ::windows::core::IUnknown); impl ISpecifyPropertyPages { pub unsafe fn GetPages(&self) -> ::windows::core::Result<CAUUID> { let mut result__: <CAUUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<CAUUID>(result__) } } unsafe impl ::windows::core::Interface for ISpecifyPropertyPages { type Vtable = ISpecifyPropertyPages_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb196b28b_bab4_101a_b69c_00aa00341d07); } impl ::core::convert::From<ISpecifyPropertyPages> for ::windows::core::IUnknown { fn from(value: ISpecifyPropertyPages) -> Self { value.0 } } impl ::core::convert::From<&ISpecifyPropertyPages> for ::windows::core::IUnknown { fn from(value: &ISpecifyPropertyPages) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ISpecifyPropertyPages { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ISpecifyPropertyPages { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ISpecifyPropertyPages_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ppages: *mut CAUUID) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ITypeChangeEvents(pub ::windows::core::IUnknown); impl ITypeChangeEvents { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn RequestTypeChange<'a, Param1: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, changekind: CHANGEKIND, ptinfobefore: Param1, pstrname: Param2) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(changekind), ptinfobefore.into_param().abi(), pstrname.into_param().abi(), &mut result__).from_abi::<i32>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn AfterTypeChange<'a, Param1: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, changekind: CHANGEKIND, ptinfoafter: Param1, pstrname: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(changekind), ptinfoafter.into_param().abi(), pstrname.into_param().abi()).ok() } } unsafe impl ::windows::core::Interface for ITypeChangeEvents { type Vtable = ITypeChangeEvents_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00020410_0000_0000_c000_000000000046); } impl ::core::convert::From<ITypeChangeEvents> for ::windows::core::IUnknown { fn from(value: ITypeChangeEvents) -> Self { value.0 } } impl ::core::convert::From<&ITypeChangeEvents> for ::windows::core::IUnknown { fn from(value: &ITypeChangeEvents) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ITypeChangeEvents { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ITypeChangeEvents { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ITypeChangeEvents_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, changekind: CHANGEKIND, ptinfobefore: ::windows::core::RawPtr, pstrname: super::super::Foundation::PWSTR, pfcancel: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, changekind: CHANGEKIND, ptinfoafter: ::windows::core::RawPtr, pstrname: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ITypeFactory(pub ::windows::core::IUnknown); impl ITypeFactory { #[cfg(feature = "Win32_System_Com")] pub unsafe fn CreateFromTypeInfo<'a, Param0: ::windows::core::IntoParam<'a, super::Com::ITypeInfo>>(&self, ptypeinfo: Param0, riid: *const ::windows::core::GUID) -> ::windows::core::Result<::windows::core::IUnknown> { let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ptypeinfo.into_param().abi(), ::core::mem::transmute(riid), &mut result__).from_abi::<::windows::core::IUnknown>(result__) } } unsafe impl ::windows::core::Interface for ITypeFactory { type Vtable = ITypeFactory_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000002e_0000_0000_c000_000000000046); } impl ::core::convert::From<ITypeFactory> for ::windows::core::IUnknown { fn from(value: ITypeFactory) -> Self { value.0 } } impl ::core::convert::From<&ITypeFactory> for ::windows::core::IUnknown { fn from(value: &ITypeFactory) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ITypeFactory { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ITypeFactory { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ITypeFactory_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ptypeinfo: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppv: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct ITypeMarshal(pub ::windows::core::IUnknown); impl ITypeMarshal { pub unsafe fn Size(&self, pvtype: *const ::core::ffi::c_void, dwdestcontext: u32, pvdestcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvtype), ::core::mem::transmute(dwdestcontext), ::core::mem::transmute(pvdestcontext), &mut result__).from_abi::<u32>(result__) } pub unsafe fn Marshal(&self, pvtype: *const ::core::ffi::c_void, dwdestcontext: u32, pvdestcontext: *const ::core::ffi::c_void, cbbufferlength: u32, pbuffer: *mut u8, pcbwritten: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvtype), ::core::mem::transmute(dwdestcontext), ::core::mem::transmute(pvdestcontext), ::core::mem::transmute(cbbufferlength), ::core::mem::transmute(pbuffer), ::core::mem::transmute(pcbwritten)).ok() } pub unsafe fn Unmarshal(&self, pvtype: *mut ::core::ffi::c_void, dwflags: u32, cbbufferlength: u32, pbuffer: *const u8, pcbread: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvtype), ::core::mem::transmute(dwflags), ::core::mem::transmute(cbbufferlength), ::core::mem::transmute(pbuffer), ::core::mem::transmute(pcbread)).ok() } pub unsafe fn Free(&self, pvtype: *const ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvtype)).ok() } } unsafe impl ::windows::core::Interface for ITypeMarshal { type Vtable = ITypeMarshal_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000002d_0000_0000_c000_000000000046); } impl ::core::convert::From<ITypeMarshal> for ::windows::core::IUnknown { fn from(value: ITypeMarshal) -> Self { value.0 } } impl ::core::convert::From<&ITypeMarshal> for ::windows::core::IUnknown { fn from(value: &ITypeMarshal) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for ITypeMarshal { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a ITypeMarshal { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct ITypeMarshal_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvtype: *const ::core::ffi::c_void, dwdestcontext: u32, pvdestcontext: *const ::core::ffi::c_void, psize: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvtype: *const ::core::ffi::c_void, dwdestcontext: u32, pvdestcontext: *const ::core::ffi::c_void, cbbufferlength: u32, pbuffer: *mut u8, pcbwritten: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvtype: *mut ::core::ffi::c_void, dwflags: u32, cbbufferlength: u32, pbuffer: *const u8, pcbread: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvtype: *const ::core::ffi::c_void) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IVBFormat(pub ::windows::core::IUnknown); impl IVBFormat { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn Format<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(&self, vdata: *mut super::Com::VARIANT, bstrformat: Param1, lpbuffer: *mut ::core::ffi::c_void, cb: u16, lcid: i32, sfirstdayofweek: i16, sfirstweekofyear: u16, rcb: *mut u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(vdata), bstrformat.into_param().abi(), ::core::mem::transmute(lpbuffer), ::core::mem::transmute(cb), ::core::mem::transmute(lcid), ::core::mem::transmute(sfirstdayofweek), ::core::mem::transmute(sfirstweekofyear), ::core::mem::transmute(rcb)).ok() } } unsafe impl ::windows::core::Interface for IVBFormat { type Vtable = IVBFormat_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9849fd60_3768_101b_8d72_ae6164ffe3cf); } impl ::core::convert::From<IVBFormat> for ::windows::core::IUnknown { fn from(value: IVBFormat) -> Self { value.0 } } impl ::core::convert::From<&IVBFormat> for ::windows::core::IUnknown { fn from(value: &IVBFormat) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IVBFormat { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IVBFormat { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IVBFormat_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, vdata: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, bstrformat: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, lpbuffer: *mut ::core::ffi::c_void, cb: u16, lcid: i32, sfirstdayofweek: i16, sfirstweekofyear: u16, rcb: *mut u16) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IVBGetControl(pub ::windows::core::IUnknown); impl IVBGetControl { #[cfg(feature = "Win32_System_Com")] pub unsafe fn EnumControls(&self, dwolecontf: OLECONTF, dwwhich: ENUM_CONTROLS_WHICH_FLAGS) -> ::windows::core::Result<super::Com::IEnumUnknown> { let mut result__: <super::Com::IEnumUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwolecontf), ::core::mem::transmute(dwwhich), &mut result__).from_abi::<super::Com::IEnumUnknown>(result__) } } unsafe impl ::windows::core::Interface for IVBGetControl { type Vtable = IVBGetControl_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x40a050a0_3c31_101b_a82e_08002b2b2337); } impl ::core::convert::From<IVBGetControl> for ::windows::core::IUnknown { fn from(value: IVBGetControl) -> Self { value.0 } } impl ::core::convert::From<&IVBGetControl> for ::windows::core::IUnknown { fn from(value: &IVBGetControl) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IVBGetControl { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IVBGetControl { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IVBGetControl_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwolecontf: OLECONTF, dwwhich: ENUM_CONTROLS_WHICH_FLAGS, ppenumunk: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IVariantChangeType(pub ::windows::core::IUnknown); impl IVariantChangeType { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn ChangeType(&self, pvardst: *mut super::Com::VARIANT, pvarsrc: *const super::Com::VARIANT, lcid: u32, vtnew: u16) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(pvardst), ::core::mem::transmute(pvarsrc), ::core::mem::transmute(lcid), ::core::mem::transmute(vtnew)).ok() } } unsafe impl ::windows::core::Interface for IVariantChangeType { type Vtable = IVariantChangeType_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa6ef9862_c720_11d0_9337_00a0c90dcaa9); } impl ::core::convert::From<IVariantChangeType> for ::windows::core::IUnknown { fn from(value: IVariantChangeType) -> Self { value.0 } } impl ::core::convert::From<&IVariantChangeType> for ::windows::core::IUnknown { fn from(value: &IVariantChangeType) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IVariantChangeType { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IVariantChangeType { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IVariantChangeType_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pvardst: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarsrc: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, lcid: u32, vtnew: u16) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IViewObject(pub ::windows::core::IUnknown); impl IViewObject { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn Draw<'a, Param4: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param5: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>( &self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hdctargetdev: Param4, hdcdraw: Param5, lprcbounds: *const super::super::Foundation::RECTL, lprcwbounds: *const super::super::Foundation::RECTL, pfncontinue: isize, dwcontinue: usize, ) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)( ::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(ptd), hdctargetdev.into_param().abi(), hdcdraw.into_param().abi(), ::core::mem::transmute(lprcbounds), ::core::mem::transmute(lprcwbounds), ::core::mem::transmute(pfncontinue), ::core::mem::transmute(dwcontinue), ) .ok() } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn GetColorSet<'a, Param4: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: Param4, ppcolorset: *mut *mut super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(ptd), hictargetdev.into_param().abi(), ::core::mem::transmute(ppcolorset)).ok() } pub unsafe fn Freeze(&self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, pdwfreeze: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(pdwfreeze)).ok() } pub unsafe fn Unfreeze(&self, dwfreeze: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwfreeze)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetAdvise<'a, Param2: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>>(&self, aspects: u32, advf: u32, padvsink: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(aspects), ::core::mem::transmute(advf), padvsink.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetAdvise(&self, paspects: *mut u32, padvf: *mut u32, ppadvsink: *mut ::core::option::Option<super::Com::IAdviseSink>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(paspects), ::core::mem::transmute(padvf), ::core::mem::transmute(ppadvsink)).ok() } } unsafe impl ::windows::core::Interface for IViewObject { type Vtable = IViewObject_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0000010d_0000_0000_c000_000000000046); } impl ::core::convert::From<IViewObject> for ::windows::core::IUnknown { fn from(value: IViewObject) -> Self { value.0 } } impl ::core::convert::From<&IViewObject> for ::windows::core::IUnknown { fn from(value: &IViewObject) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IViewObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IViewObject { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IViewObject_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hdctargetdev: super::super::Graphics::Gdi::HDC, hdcdraw: super::super::Graphics::Gdi::HDC, lprcbounds: *const super::super::Foundation::RECTL, lprcwbounds: *const super::super::Foundation::RECTL, pfncontinue: isize, dwcontinue: usize) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: super::super::Graphics::Gdi::HDC, ppcolorset: *mut *mut super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, pdwfreeze: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwfreeze: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, aspects: u32, advf: u32, padvsink: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paspects: *mut u32, padvf: *mut u32, ppadvsink: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IViewObject2(pub ::windows::core::IUnknown); impl IViewObject2 { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn Draw<'a, Param4: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param5: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>( &self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hdctargetdev: Param4, hdcdraw: Param5, lprcbounds: *const super::super::Foundation::RECTL, lprcwbounds: *const super::super::Foundation::RECTL, pfncontinue: isize, dwcontinue: usize, ) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)( ::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(ptd), hdctargetdev.into_param().abi(), hdcdraw.into_param().abi(), ::core::mem::transmute(lprcbounds), ::core::mem::transmute(lprcwbounds), ::core::mem::transmute(pfncontinue), ::core::mem::transmute(dwcontinue), ) .ok() } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn GetColorSet<'a, Param4: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: Param4, ppcolorset: *mut *mut super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(ptd), hictargetdev.into_param().abi(), ::core::mem::transmute(ppcolorset)).ok() } pub unsafe fn Freeze(&self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, pdwfreeze: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(pdwfreeze)).ok() } pub unsafe fn Unfreeze(&self, dwfreeze: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwfreeze)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetAdvise<'a, Param2: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>>(&self, aspects: u32, advf: u32, padvsink: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(aspects), ::core::mem::transmute(advf), padvsink.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetAdvise(&self, paspects: *mut u32, padvf: *mut u32, ppadvsink: *mut ::core::option::Option<super::Com::IAdviseSink>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(paspects), ::core::mem::transmute(padvf), ::core::mem::transmute(ppadvsink)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn GetExtent(&self, dwdrawaspect: u32, lindex: i32, ptd: *const super::Com::DVTARGETDEVICE) -> ::windows::core::Result<super::super::Foundation::SIZE> { let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(ptd), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__) } } unsafe impl ::windows::core::Interface for IViewObject2 { type Vtable = IViewObject2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x00000127_0000_0000_c000_000000000046); } impl ::core::convert::From<IViewObject2> for ::windows::core::IUnknown { fn from(value: IViewObject2) -> Self { value.0 } } impl ::core::convert::From<&IViewObject2> for ::windows::core::IUnknown { fn from(value: &IViewObject2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IViewObject2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IViewObject2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IViewObject2> for IViewObject { fn from(value: IViewObject2) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IViewObject2> for IViewObject { fn from(value: &IViewObject2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IViewObject> for IViewObject2 { fn into_param(self) -> ::windows::core::Param<'a, IViewObject> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IViewObject> for &IViewObject2 { fn into_param(self) -> ::windows::core::Param<'a, IViewObject> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IViewObject2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hdctargetdev: super::super::Graphics::Gdi::HDC, hdcdraw: super::super::Graphics::Gdi::HDC, lprcbounds: *const super::super::Foundation::RECTL, lprcwbounds: *const super::super::Foundation::RECTL, pfncontinue: isize, dwcontinue: usize) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: super::super::Graphics::Gdi::HDC, ppcolorset: *mut *mut super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, pdwfreeze: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwfreeze: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, aspects: u32, advf: u32, padvsink: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paspects: *mut u32, padvf: *mut u32, ppadvsink: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, ptd: *const super::Com::DVTARGETDEVICE, lpsizel: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IViewObjectEx(pub ::windows::core::IUnknown); impl IViewObjectEx { #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn Draw<'a, Param4: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param5: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>( &self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hdctargetdev: Param4, hdcdraw: Param5, lprcbounds: *const super::super::Foundation::RECTL, lprcwbounds: *const super::super::Foundation::RECTL, pfncontinue: isize, dwcontinue: usize, ) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)( ::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(ptd), hdctargetdev.into_param().abi(), hdcdraw.into_param().abi(), ::core::mem::transmute(lprcbounds), ::core::mem::transmute(lprcwbounds), ::core::mem::transmute(pfncontinue), ::core::mem::transmute(dwcontinue), ) .ok() } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn GetColorSet<'a, Param4: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: Param4, ppcolorset: *mut *mut super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(ptd), hictargetdev.into_param().abi(), ::core::mem::transmute(ppcolorset)).ok() } pub unsafe fn Freeze(&self, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, pdwfreeze: *mut u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(pvaspect), ::core::mem::transmute(pdwfreeze)).ok() } pub unsafe fn Unfreeze(&self, dwfreeze: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwfreeze)).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn SetAdvise<'a, Param2: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>>(&self, aspects: u32, advf: u32, padvsink: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(aspects), ::core::mem::transmute(advf), padvsink.into_param().abi()).ok() } #[cfg(feature = "Win32_System_Com")] pub unsafe fn GetAdvise(&self, paspects: *mut u32, padvf: *mut u32, ppadvsink: *mut ::core::option::Option<super::Com::IAdviseSink>) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(paspects), ::core::mem::transmute(padvf), ::core::mem::transmute(ppadvsink)).ok() } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe fn GetExtent(&self, dwdrawaspect: u32, lindex: i32, ptd: *const super::Com::DVTARGETDEVICE) -> ::windows::core::Result<super::super::Foundation::SIZE> { let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwdrawaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(ptd), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetRect(&self, dwaspect: u32) -> ::windows::core::Result<super::super::Foundation::RECTL> { let mut result__: <super::super::Foundation::RECTL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwaspect), &mut result__).from_abi::<super::super::Foundation::RECTL>(result__) } pub unsafe fn GetViewStatus(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn QueryHitPoint<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::POINT>>(&self, dwaspect: u32, prectbounds: *const super::super::Foundation::RECT, ptlloc: Param2, lclosehint: i32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwaspect), ::core::mem::transmute(prectbounds), ptlloc.into_param().abi(), ::core::mem::transmute(lclosehint), &mut result__).from_abi::<u32>(result__) } #[cfg(feature = "Win32_Foundation")] pub unsafe fn QueryHitRect(&self, dwaspect: u32, prectbounds: *const super::super::Foundation::RECT, prectloc: *const super::super::Foundation::RECT, lclosehint: i32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwaspect), ::core::mem::transmute(prectbounds), ::core::mem::transmute(prectloc), ::core::mem::transmute(lclosehint), &mut result__).from_abi::<u32>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe fn GetNaturalExtent<'a, Param3: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(&self, dwaspect: super::Com::DVASPECT, lindex: i32, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: Param3, pextentinfo: *const ExtentInfo) -> ::windows::core::Result<super::super::Foundation::SIZE> { let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(dwaspect), ::core::mem::transmute(lindex), ::core::mem::transmute(ptd), hictargetdev.into_param().abi(), ::core::mem::transmute(pextentinfo), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__) } } unsafe impl ::windows::core::Interface for IViewObjectEx { type Vtable = IViewObjectEx_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3af24292_0c96_11ce_a0cf_00aa00600ab8); } impl ::core::convert::From<IViewObjectEx> for ::windows::core::IUnknown { fn from(value: IViewObjectEx) -> Self { value.0 } } impl ::core::convert::From<&IViewObjectEx> for ::windows::core::IUnknown { fn from(value: &IViewObjectEx) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IViewObjectEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IViewObjectEx { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IViewObjectEx> for IViewObject2 { fn from(value: IViewObjectEx) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IViewObjectEx> for IViewObject2 { fn from(value: &IViewObjectEx) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IViewObject2> for IViewObjectEx { fn into_param(self) -> ::windows::core::Param<'a, IViewObject2> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IViewObject2> for &IViewObjectEx { fn into_param(self) -> ::windows::core::Param<'a, IViewObject2> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } impl ::core::convert::From<IViewObjectEx> for IViewObject { fn from(value: IViewObjectEx) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IViewObjectEx> for IViewObject { fn from(value: &IViewObjectEx) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IViewObject> for IViewObjectEx { fn into_param(self) -> ::windows::core::Param<'a, IViewObject> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IViewObject> for &IViewObjectEx { fn into_param(self) -> ::windows::core::Param<'a, IViewObject> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IViewObjectEx_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hdctargetdev: super::super::Graphics::Gdi::HDC, hdcdraw: super::super::Graphics::Gdi::HDC, lprcbounds: *const super::super::Foundation::RECTL, lprcwbounds: *const super::super::Foundation::RECTL, pfncontinue: isize, dwcontinue: usize) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: super::super::Graphics::Gdi::HDC, ppcolorset: *mut *mut super::super::Graphics::Gdi::LOGPALETTE) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, pvaspect: *mut ::core::ffi::c_void, pdwfreeze: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwfreeze: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, aspects: u32, advf: u32, padvsink: ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paspects: *mut u32, padvf: *mut u32, ppadvsink: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_System_Com"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwdrawaspect: u32, lindex: i32, ptd: *const super::Com::DVTARGETDEVICE, lpsizel: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwaspect: u32, prect: *mut super::super::Foundation::RECTL) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pdwstatus: *mut u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwaspect: u32, prectbounds: *const super::super::Foundation::RECT, ptlloc: super::super::Foundation::POINT, lclosehint: i32, phitresult: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwaspect: u32, prectbounds: *const super::super::Foundation::RECT, prectloc: *const super::super::Foundation::RECT, lclosehint: i32, phitresult: *mut u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dwaspect: super::Com::DVASPECT, lindex: i32, ptd: *const super::Com::DVTARGETDEVICE, hictargetdev: super::super::Graphics::Gdi::HDC, pextentinfo: *const ExtentInfo, psizel: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com")))] usize, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IZoomEvents(pub ::windows::core::IUnknown); impl IZoomEvents { pub unsafe fn OnZoomPercentChanged(&self, ulzoompercent: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(ulzoompercent)).ok() } } unsafe impl ::windows::core::Interface for IZoomEvents { type Vtable = IZoomEvents_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x41b68150_904c_4e17_a0ba_a438182e359d); } impl ::core::convert::From<IZoomEvents> for ::windows::core::IUnknown { fn from(value: IZoomEvents) -> Self { value.0 } } impl ::core::convert::From<&IZoomEvents> for ::windows::core::IUnknown { fn from(value: &IZoomEvents) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IZoomEvents { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Owned(self.0) } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IZoomEvents { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IZoomEvents_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ulzoompercent: u32) -> ::windows::core::HRESULT, ); #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn IsAccelerator<'a, Param0: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HACCEL>>(haccel: Param0, caccelentries: i32, lpmsg: *mut super::super::UI::WindowsAndMessaging::MSG, lpwcmd: *mut u16) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsAccelerator(haccel: super::super::UI::WindowsAndMessaging::HACCEL, caccelentries: i32, lpmsg: *mut super::super::UI::WindowsAndMessaging::MSG, lpwcmd: *mut u16) -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsAccelerator(haccel.into_param().abi(), ::core::mem::transmute(caccelentries), ::core::mem::transmute(lpmsg), ::core::mem::transmute(lpwcmd))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn LHashValOfNameSys<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(syskind: super::Com::SYSKIND, lcid: u32, szname: Param2) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LHashValOfNameSys(syskind: super::Com::SYSKIND, lcid: u32, szname: super::super::Foundation::PWSTR) -> u32; } ::core::mem::transmute(LHashValOfNameSys(::core::mem::transmute(syskind), ::core::mem::transmute(lcid), szname.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn LHashValOfNameSysA<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(syskind: super::Com::SYSKIND, lcid: u32, szname: Param2) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LHashValOfNameSysA(syskind: super::Com::SYSKIND, lcid: u32, szname: super::super::Foundation::PSTR) -> u32; } ::core::mem::transmute(LHashValOfNameSysA(::core::mem::transmute(syskind), ::core::mem::transmute(lcid), szname.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct LIBFLAGS(pub i32); pub const LIBFLAG_FRESTRICTED: LIBFLAGS = LIBFLAGS(1i32); pub const LIBFLAG_FCONTROL: LIBFLAGS = LIBFLAGS(2i32); pub const LIBFLAG_FHIDDEN: LIBFLAGS = LIBFLAGS(4i32); pub const LIBFLAG_FHASDISKIMAGE: LIBFLAGS = LIBFLAGS(8i32); impl ::core::convert::From<i32> for LIBFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LIBFLAGS { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LICINFO { pub cbLicInfo: i32, pub fRuntimeKeyAvail: super::super::Foundation::BOOL, pub fLicVerified: super::super::Foundation::BOOL, } #[cfg(feature = "Win32_Foundation")] impl LICINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LICINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LICINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LICINFO").field("cbLicInfo", &self.cbLicInfo).field("fRuntimeKeyAvail", &self.fRuntimeKeyAvail).field("fLicVerified", &self.fLicVerified).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LICINFO { fn eq(&self, other: &Self) -> bool { self.cbLicInfo == other.cbLicInfo && self.fRuntimeKeyAvail == other.fRuntimeKeyAvail && self.fLicVerified == other.fLicVerified } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LICINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LICINFO { type Abi = Self; } pub const LOAD_TLB_AS_32BIT: u32 = 32u32; pub const LOAD_TLB_AS_64BIT: u32 = 64u32; pub const LOCALE_USE_NLS: u32 = 268435456u32; #[cfg(feature = "Win32_Foundation")] pub type LPFNOLEUIHOOK = unsafe extern "system" fn(param0: super::super::Foundation::HWND, param1: u32, param2: super::super::Foundation::WPARAM, param3: super::super::Foundation::LPARAM) -> u32; pub const LP_COLOR: u32 = 4u32; pub const LP_DEFAULT: u32 = 0u32; pub const LP_MONOCHROME: u32 = 1u32; pub const LP_VGACOLOR: u32 = 2u32; #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn LoadRegTypeLib(rguid: *const ::windows::core::GUID, wvermajor: u16, wverminor: u16, lcid: u32) -> ::windows::core::Result<super::Com::ITypeLib> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LoadRegTypeLib(rguid: *const ::windows::core::GUID, wvermajor: u16, wverminor: u16, lcid: u32, pptlib: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <super::Com::ITypeLib as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); LoadRegTypeLib(::core::mem::transmute(rguid), ::core::mem::transmute(wvermajor), ::core::mem::transmute(wverminor), ::core::mem::transmute(lcid), &mut result__).from_abi::<super::Com::ITypeLib>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn LoadTypeLib<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(szfile: Param0) -> ::windows::core::Result<super::Com::ITypeLib> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LoadTypeLib(szfile: super::super::Foundation::PWSTR, pptlib: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <super::Com::ITypeLib as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); LoadTypeLib(szfile.into_param().abi(), &mut result__).from_abi::<super::Com::ITypeLib>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn LoadTypeLibEx<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(szfile: Param0, regkind: REGKIND) -> ::windows::core::Result<super::Com::ITypeLib> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LoadTypeLibEx(szfile: super::super::Foundation::PWSTR, regkind: REGKIND, pptlib: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <super::Com::ITypeLib as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); LoadTypeLibEx(szfile.into_param().abi(), ::core::mem::transmute(regkind), &mut result__).from_abi::<super::Com::ITypeLib>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct MEDIAPLAYBACK_STATE(pub i32); pub const MEDIAPLAYBACK_RESUME: MEDIAPLAYBACK_STATE = MEDIAPLAYBACK_STATE(0i32); pub const MEDIAPLAYBACK_PAUSE: MEDIAPLAYBACK_STATE = MEDIAPLAYBACK_STATE(1i32); pub const MEDIAPLAYBACK_PAUSE_AND_SUSPEND: MEDIAPLAYBACK_STATE = MEDIAPLAYBACK_STATE(2i32); pub const MEDIAPLAYBACK_RESUME_FROM_SUSPEND: MEDIAPLAYBACK_STATE = MEDIAPLAYBACK_STATE(3i32); impl ::core::convert::From<i32> for MEDIAPLAYBACK_STATE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MEDIAPLAYBACK_STATE { type Abi = Self; } pub const MEMBERID_NIL: i32 = -1i32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct METHODDATA { pub szName: super::super::Foundation::PWSTR, pub ppdata: *mut PARAMDATA, pub dispid: i32, pub iMeth: u32, pub cc: super::Com::CALLCONV, pub cArgs: u32, pub wFlags: u16, pub vtReturn: u16, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl METHODDATA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for METHODDATA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for METHODDATA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("METHODDATA").field("szName", &self.szName).field("ppdata", &self.ppdata).field("dispid", &self.dispid).field("iMeth", &self.iMeth).field("cc", &self.cc).field("cArgs", &self.cArgs).field("wFlags", &self.wFlags).field("vtReturn", &self.vtReturn).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for METHODDATA { fn eq(&self, other: &Self) -> bool { self.szName == other.szName && self.ppdata == other.ppdata && self.dispid == other.dispid && self.iMeth == other.iMeth && self.cc == other.cc && self.cArgs == other.cArgs && self.wFlags == other.wFlags && self.vtReturn == other.vtReturn } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for METHODDATA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for METHODDATA { type Abi = Self; } pub const MK_ALT: u32 = 32u32; pub const MSOCMDERR_E_CANCELED: i32 = -2147221245i32; pub const MSOCMDERR_E_DISABLED: i32 = -2147221247i32; pub const MSOCMDERR_E_FIRST: i32 = -2147221248i32; pub const MSOCMDERR_E_NOHELP: i32 = -2147221246i32; pub const MSOCMDERR_E_NOTSUPPORTED: i32 = -2147221248i32; pub const MSOCMDERR_E_UNKNOWNGROUP: i32 = -2147221244i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct MULTICLASSINFO_FLAGS(pub u32); pub const MULTICLASSINFO_GETTYPEINFO: MULTICLASSINFO_FLAGS = MULTICLASSINFO_FLAGS(1u32); pub const MULTICLASSINFO_GETNUMRESERVEDDISPIDS: MULTICLASSINFO_FLAGS = MULTICLASSINFO_FLAGS(2u32); pub const MULTICLASSINFO_GETIIDPRIMARY: MULTICLASSINFO_FLAGS = MULTICLASSINFO_FLAGS(4u32); pub const MULTICLASSINFO_GETIIDSOURCE: MULTICLASSINFO_FLAGS = MULTICLASSINFO_FLAGS(8u32); impl ::core::convert::From<u32> for MULTICLASSINFO_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MULTICLASSINFO_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for MULTICLASSINFO_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for MULTICLASSINFO_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for MULTICLASSINFO_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for MULTICLASSINFO_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for MULTICLASSINFO_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct NUMPARSE { pub cDig: i32, pub dwInFlags: u32, pub dwOutFlags: u32, pub cchUsed: i32, pub nBaseShift: i32, pub nPwr10: i32, } impl NUMPARSE {} impl ::core::default::Default for NUMPARSE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for NUMPARSE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NUMPARSE").field("cDig", &self.cDig).field("dwInFlags", &self.dwInFlags).field("dwOutFlags", &self.dwOutFlags).field("cchUsed", &self.cchUsed).field("nBaseShift", &self.nBaseShift).field("nPwr10", &self.nPwr10).finish() } } impl ::core::cmp::PartialEq for NUMPARSE { fn eq(&self, other: &Self) -> bool { self.cDig == other.cDig && self.dwInFlags == other.dwInFlags && self.dwOutFlags == other.dwOutFlags && self.cchUsed == other.cchUsed && self.nBaseShift == other.nBaseShift && self.nPwr10 == other.nPwr10 } } impl ::core::cmp::Eq for NUMPARSE {} unsafe impl ::windows::core::Abi for NUMPARSE { type Abi = Self; } pub const NUMPRS_CURRENCY: u32 = 1024u32; pub const NUMPRS_DECIMAL: u32 = 256u32; pub const NUMPRS_EXPONENT: u32 = 2048u32; pub const NUMPRS_HEX_OCT: u32 = 64u32; pub const NUMPRS_INEXACT: u32 = 131072u32; pub const NUMPRS_LEADING_MINUS: u32 = 16u32; pub const NUMPRS_LEADING_PLUS: u32 = 4u32; pub const NUMPRS_LEADING_WHITE: u32 = 1u32; pub const NUMPRS_NEG: u32 = 65536u32; pub const NUMPRS_PARENS: u32 = 128u32; pub const NUMPRS_STD: u32 = 8191u32; pub const NUMPRS_THOUSANDS: u32 = 512u32; pub const NUMPRS_TRAILING_MINUS: u32 = 32u32; pub const NUMPRS_TRAILING_PLUS: u32 = 8u32; pub const NUMPRS_TRAILING_WHITE: u32 = 2u32; pub const NUMPRS_USE_ALL: u32 = 4096u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OBJECTDESCRIPTOR { pub cbSize: u32, pub clsid: ::windows::core::GUID, pub dwDrawAspect: u32, pub sizel: super::super::Foundation::SIZE, pub pointl: super::super::Foundation::POINTL, pub dwStatus: u32, pub dwFullUserTypeName: u32, pub dwSrcOfCopy: u32, } #[cfg(feature = "Win32_Foundation")] impl OBJECTDESCRIPTOR {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OBJECTDESCRIPTOR { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OBJECTDESCRIPTOR { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OBJECTDESCRIPTOR") .field("cbSize", &self.cbSize) .field("clsid", &self.clsid) .field("dwDrawAspect", &self.dwDrawAspect) .field("sizel", &self.sizel) .field("pointl", &self.pointl) .field("dwStatus", &self.dwStatus) .field("dwFullUserTypeName", &self.dwFullUserTypeName) .field("dwSrcOfCopy", &self.dwSrcOfCopy) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OBJECTDESCRIPTOR { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.clsid == other.clsid && self.dwDrawAspect == other.dwDrawAspect && self.sizel == other.sizel && self.pointl == other.pointl && self.dwStatus == other.dwStatus && self.dwFullUserTypeName == other.dwFullUserTypeName && self.dwSrcOfCopy == other.dwSrcOfCopy } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OBJECTDESCRIPTOR {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OBJECTDESCRIPTOR { type Abi = Self; } pub const OCM__BASE: u32 = 8192u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OCPFIPARAMS { pub cbStructSize: u32, pub hWndOwner: super::super::Foundation::HWND, pub x: i32, pub y: i32, pub lpszCaption: super::super::Foundation::PWSTR, pub cObjects: u32, pub lplpUnk: *mut ::core::option::Option<::windows::core::IUnknown>, pub cPages: u32, pub lpPages: *mut ::windows::core::GUID, pub lcid: u32, pub dispidInitialProperty: i32, } #[cfg(feature = "Win32_Foundation")] impl OCPFIPARAMS {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OCPFIPARAMS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OCPFIPARAMS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OCPFIPARAMS") .field("cbStructSize", &self.cbStructSize) .field("hWndOwner", &self.hWndOwner) .field("x", &self.x) .field("y", &self.y) .field("lpszCaption", &self.lpszCaption) .field("cObjects", &self.cObjects) .field("lplpUnk", &self.lplpUnk) .field("cPages", &self.cPages) .field("lpPages", &self.lpPages) .field("lcid", &self.lcid) .field("dispidInitialProperty", &self.dispidInitialProperty) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OCPFIPARAMS { fn eq(&self, other: &Self) -> bool { self.cbStructSize == other.cbStructSize && self.hWndOwner == other.hWndOwner && self.x == other.x && self.y == other.y && self.lpszCaption == other.lpszCaption && self.cObjects == other.cObjects && self.lplpUnk == other.lplpUnk && self.cPages == other.cPages && self.lpPages == other.lpPages && self.lcid == other.lcid && self.dispidInitialProperty == other.dispidInitialProperty } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OCPFIPARAMS {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OCPFIPARAMS { type Abi = Self; } pub const OF_GET: u32 = 2u32; pub const OF_HANDLER: u32 = 4u32; pub const OF_SET: u32 = 1u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OIFI { pub cb: u32, pub fMDIApp: super::super::Foundation::BOOL, pub hwndFrame: super::super::Foundation::HWND, pub haccel: super::super::UI::WindowsAndMessaging::HACCEL, pub cAccelEntries: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl OIFI {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OIFI { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OIFI { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OIFI").field("cb", &self.cb).field("fMDIApp", &self.fMDIApp).field("hwndFrame", &self.hwndFrame).field("haccel", &self.haccel).field("cAccelEntries", &self.cAccelEntries).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OIFI { fn eq(&self, other: &Self) -> bool { self.cb == other.cb && self.fMDIApp == other.fMDIApp && self.hwndFrame == other.hwndFrame && self.haccel == other.haccel && self.cAccelEntries == other.cAccelEntries } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OIFI {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OIFI { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECLOSE(pub i32); pub const OLECLOSE_SAVEIFDIRTY: OLECLOSE = OLECLOSE(0i32); pub const OLECLOSE_NOSAVE: OLECLOSE = OLECLOSE(1i32); pub const OLECLOSE_PROMPTSAVE: OLECLOSE = OLECLOSE(2i32); impl ::core::convert::From<i32> for OLECLOSE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECLOSE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct OLECMD { pub cmdID: u32, pub cmdf: u32, } impl OLECMD {} impl ::core::default::Default for OLECMD { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for OLECMD { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLECMD").field("cmdID", &self.cmdID).field("cmdf", &self.cmdf).finish() } } impl ::core::cmp::PartialEq for OLECMD { fn eq(&self, other: &Self) -> bool { self.cmdID == other.cmdID && self.cmdf == other.cmdf } } impl ::core::cmp::Eq for OLECMD {} unsafe impl ::windows::core::Abi for OLECMD { type Abi = Self; } pub const OLECMDARGINDEX_ACTIVEXINSTALL_CLSID: u32 = 2u32; pub const OLECMDARGINDEX_ACTIVEXINSTALL_DISPLAYNAME: u32 = 1u32; pub const OLECMDARGINDEX_ACTIVEXINSTALL_INSTALLSCOPE: u32 = 3u32; pub const OLECMDARGINDEX_ACTIVEXINSTALL_PUBLISHER: u32 = 0u32; pub const OLECMDARGINDEX_ACTIVEXINSTALL_SOURCEURL: u32 = 4u32; pub const OLECMDARGINDEX_SHOWPAGEACTIONMENU_HWND: u32 = 0u32; pub const OLECMDARGINDEX_SHOWPAGEACTIONMENU_X: u32 = 1u32; pub const OLECMDARGINDEX_SHOWPAGEACTIONMENU_Y: u32 = 2u32; pub const OLECMDERR_E_CANCELED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147221245i32 as _); pub const OLECMDERR_E_DISABLED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147221247i32 as _); pub const OLECMDERR_E_FIRST: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147221248i32 as _); pub const OLECMDERR_E_NOHELP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147221246i32 as _); pub const OLECMDERR_E_NOTSUPPORTED: i32 = -2147221248i32; pub const OLECMDERR_E_UNKNOWNGROUP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147221244i32 as _); #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDEXECOPT(pub i32); pub const OLECMDEXECOPT_DODEFAULT: OLECMDEXECOPT = OLECMDEXECOPT(0i32); pub const OLECMDEXECOPT_PROMPTUSER: OLECMDEXECOPT = OLECMDEXECOPT(1i32); pub const OLECMDEXECOPT_DONTPROMPTUSER: OLECMDEXECOPT = OLECMDEXECOPT(2i32); pub const OLECMDEXECOPT_SHOWHELP: OLECMDEXECOPT = OLECMDEXECOPT(3i32); impl ::core::convert::From<i32> for OLECMDEXECOPT { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDEXECOPT { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDF(pub i32); pub const OLECMDF_SUPPORTED: OLECMDF = OLECMDF(1i32); pub const OLECMDF_ENABLED: OLECMDF = OLECMDF(2i32); pub const OLECMDF_LATCHED: OLECMDF = OLECMDF(4i32); pub const OLECMDF_NINCHED: OLECMDF = OLECMDF(8i32); pub const OLECMDF_INVISIBLE: OLECMDF = OLECMDF(16i32); pub const OLECMDF_DEFHIDEONCTXTMENU: OLECMDF = OLECMDF(32i32); impl ::core::convert::From<i32> for OLECMDF { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDF { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDID(pub i32); pub const OLECMDID_OPEN: OLECMDID = OLECMDID(1i32); pub const OLECMDID_NEW: OLECMDID = OLECMDID(2i32); pub const OLECMDID_SAVE: OLECMDID = OLECMDID(3i32); pub const OLECMDID_SAVEAS: OLECMDID = OLECMDID(4i32); pub const OLECMDID_SAVECOPYAS: OLECMDID = OLECMDID(5i32); pub const OLECMDID_PRINT: OLECMDID = OLECMDID(6i32); pub const OLECMDID_PRINTPREVIEW: OLECMDID = OLECMDID(7i32); pub const OLECMDID_PAGESETUP: OLECMDID = OLECMDID(8i32); pub const OLECMDID_SPELL: OLECMDID = OLECMDID(9i32); pub const OLECMDID_PROPERTIES: OLECMDID = OLECMDID(10i32); pub const OLECMDID_CUT: OLECMDID = OLECMDID(11i32); pub const OLECMDID_COPY: OLECMDID = OLECMDID(12i32); pub const OLECMDID_PASTE: OLECMDID = OLECMDID(13i32); pub const OLECMDID_PASTESPECIAL: OLECMDID = OLECMDID(14i32); pub const OLECMDID_UNDO: OLECMDID = OLECMDID(15i32); pub const OLECMDID_REDO: OLECMDID = OLECMDID(16i32); pub const OLECMDID_SELECTALL: OLECMDID = OLECMDID(17i32); pub const OLECMDID_CLEARSELECTION: OLECMDID = OLECMDID(18i32); pub const OLECMDID_ZOOM: OLECMDID = OLECMDID(19i32); pub const OLECMDID_GETZOOMRANGE: OLECMDID = OLECMDID(20i32); pub const OLECMDID_UPDATECOMMANDS: OLECMDID = OLECMDID(21i32); pub const OLECMDID_REFRESH: OLECMDID = OLECMDID(22i32); pub const OLECMDID_STOP: OLECMDID = OLECMDID(23i32); pub const OLECMDID_HIDETOOLBARS: OLECMDID = OLECMDID(24i32); pub const OLECMDID_SETPROGRESSMAX: OLECMDID = OLECMDID(25i32); pub const OLECMDID_SETPROGRESSPOS: OLECMDID = OLECMDID(26i32); pub const OLECMDID_SETPROGRESSTEXT: OLECMDID = OLECMDID(27i32); pub const OLECMDID_SETTITLE: OLECMDID = OLECMDID(28i32); pub const OLECMDID_SETDOWNLOADSTATE: OLECMDID = OLECMDID(29i32); pub const OLECMDID_STOPDOWNLOAD: OLECMDID = OLECMDID(30i32); pub const OLECMDID_ONTOOLBARACTIVATED: OLECMDID = OLECMDID(31i32); pub const OLECMDID_FIND: OLECMDID = OLECMDID(32i32); pub const OLECMDID_DELETE: OLECMDID = OLECMDID(33i32); pub const OLECMDID_HTTPEQUIV: OLECMDID = OLECMDID(34i32); pub const OLECMDID_HTTPEQUIV_DONE: OLECMDID = OLECMDID(35i32); pub const OLECMDID_ENABLE_INTERACTION: OLECMDID = OLECMDID(36i32); pub const OLECMDID_ONUNLOAD: OLECMDID = OLECMDID(37i32); pub const OLECMDID_PROPERTYBAG2: OLECMDID = OLECMDID(38i32); pub const OLECMDID_PREREFRESH: OLECMDID = OLECMDID(39i32); pub const OLECMDID_SHOWSCRIPTERROR: OLECMDID = OLECMDID(40i32); pub const OLECMDID_SHOWMESSAGE: OLECMDID = OLECMDID(41i32); pub const OLECMDID_SHOWFIND: OLECMDID = OLECMDID(42i32); pub const OLECMDID_SHOWPAGESETUP: OLECMDID = OLECMDID(43i32); pub const OLECMDID_SHOWPRINT: OLECMDID = OLECMDID(44i32); pub const OLECMDID_CLOSE: OLECMDID = OLECMDID(45i32); pub const OLECMDID_ALLOWUILESSSAVEAS: OLECMDID = OLECMDID(46i32); pub const OLECMDID_DONTDOWNLOADCSS: OLECMDID = OLECMDID(47i32); pub const OLECMDID_UPDATEPAGESTATUS: OLECMDID = OLECMDID(48i32); pub const OLECMDID_PRINT2: OLECMDID = OLECMDID(49i32); pub const OLECMDID_PRINTPREVIEW2: OLECMDID = OLECMDID(50i32); pub const OLECMDID_SETPRINTTEMPLATE: OLECMDID = OLECMDID(51i32); pub const OLECMDID_GETPRINTTEMPLATE: OLECMDID = OLECMDID(52i32); pub const OLECMDID_PAGEACTIONBLOCKED: OLECMDID = OLECMDID(55i32); pub const OLECMDID_PAGEACTIONUIQUERY: OLECMDID = OLECMDID(56i32); pub const OLECMDID_FOCUSVIEWCONTROLS: OLECMDID = OLECMDID(57i32); pub const OLECMDID_FOCUSVIEWCONTROLSQUERY: OLECMDID = OLECMDID(58i32); pub const OLECMDID_SHOWPAGEACTIONMENU: OLECMDID = OLECMDID(59i32); pub const OLECMDID_ADDTRAVELENTRY: OLECMDID = OLECMDID(60i32); pub const OLECMDID_UPDATETRAVELENTRY: OLECMDID = OLECMDID(61i32); pub const OLECMDID_UPDATEBACKFORWARDSTATE: OLECMDID = OLECMDID(62i32); pub const OLECMDID_OPTICAL_ZOOM: OLECMDID = OLECMDID(63i32); pub const OLECMDID_OPTICAL_GETZOOMRANGE: OLECMDID = OLECMDID(64i32); pub const OLECMDID_WINDOWSTATECHANGED: OLECMDID = OLECMDID(65i32); pub const OLECMDID_ACTIVEXINSTALLSCOPE: OLECMDID = OLECMDID(66i32); pub const OLECMDID_UPDATETRAVELENTRY_DATARECOVERY: OLECMDID = OLECMDID(67i32); pub const OLECMDID_SHOWTASKDLG: OLECMDID = OLECMDID(68i32); pub const OLECMDID_POPSTATEEVENT: OLECMDID = OLECMDID(69i32); pub const OLECMDID_VIEWPORT_MODE: OLECMDID = OLECMDID(70i32); pub const OLECMDID_LAYOUT_VIEWPORT_WIDTH: OLECMDID = OLECMDID(71i32); pub const OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM: OLECMDID = OLECMDID(72i32); pub const OLECMDID_USER_OPTICAL_ZOOM: OLECMDID = OLECMDID(73i32); pub const OLECMDID_PAGEAVAILABLE: OLECMDID = OLECMDID(74i32); pub const OLECMDID_GETUSERSCALABLE: OLECMDID = OLECMDID(75i32); pub const OLECMDID_UPDATE_CARET: OLECMDID = OLECMDID(76i32); pub const OLECMDID_ENABLE_VISIBILITY: OLECMDID = OLECMDID(77i32); pub const OLECMDID_MEDIA_PLAYBACK: OLECMDID = OLECMDID(78i32); pub const OLECMDID_SETFAVICON: OLECMDID = OLECMDID(79i32); pub const OLECMDID_SET_HOST_FULLSCREENMODE: OLECMDID = OLECMDID(80i32); pub const OLECMDID_EXITFULLSCREEN: OLECMDID = OLECMDID(81i32); pub const OLECMDID_SCROLLCOMPLETE: OLECMDID = OLECMDID(82i32); pub const OLECMDID_ONBEFOREUNLOAD: OLECMDID = OLECMDID(83i32); pub const OLECMDID_SHOWMESSAGE_BLOCKABLE: OLECMDID = OLECMDID(84i32); pub const OLECMDID_SHOWTASKDLG_BLOCKABLE: OLECMDID = OLECMDID(85i32); impl ::core::convert::From<i32> for OLECMDID { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDID { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDID_BROWSERSTATEFLAG(pub i32); pub const OLECMDIDF_BROWSERSTATE_EXTENSIONSOFF: OLECMDID_BROWSERSTATEFLAG = OLECMDID_BROWSERSTATEFLAG(1i32); pub const OLECMDIDF_BROWSERSTATE_IESECURITY: OLECMDID_BROWSERSTATEFLAG = OLECMDID_BROWSERSTATEFLAG(2i32); pub const OLECMDIDF_BROWSERSTATE_PROTECTEDMODE_OFF: OLECMDID_BROWSERSTATEFLAG = OLECMDID_BROWSERSTATEFLAG(4i32); pub const OLECMDIDF_BROWSERSTATE_RESET: OLECMDID_BROWSERSTATEFLAG = OLECMDID_BROWSERSTATEFLAG(8i32); pub const OLECMDIDF_BROWSERSTATE_REQUIRESACTIVEX: OLECMDID_BROWSERSTATEFLAG = OLECMDID_BROWSERSTATEFLAG(16i32); pub const OLECMDIDF_BROWSERSTATE_DESKTOPHTMLDIALOG: OLECMDID_BROWSERSTATEFLAG = OLECMDID_BROWSERSTATEFLAG(32i32); pub const OLECMDIDF_BROWSERSTATE_BLOCKEDVERSION: OLECMDID_BROWSERSTATEFLAG = OLECMDID_BROWSERSTATEFLAG(64i32); impl ::core::convert::From<i32> for OLECMDID_BROWSERSTATEFLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDID_BROWSERSTATEFLAG { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDID_OPTICAL_ZOOMFLAG(pub i32); pub const OLECMDIDF_OPTICAL_ZOOM_NOPERSIST: OLECMDID_OPTICAL_ZOOMFLAG = OLECMDID_OPTICAL_ZOOMFLAG(1i32); pub const OLECMDIDF_OPTICAL_ZOOM_NOLAYOUT: OLECMDID_OPTICAL_ZOOMFLAG = OLECMDID_OPTICAL_ZOOMFLAG(16i32); pub const OLECMDIDF_OPTICAL_ZOOM_NOTRANSIENT: OLECMDID_OPTICAL_ZOOMFLAG = OLECMDID_OPTICAL_ZOOMFLAG(32i32); pub const OLECMDIDF_OPTICAL_ZOOM_RELOADFORNEWTAB: OLECMDID_OPTICAL_ZOOMFLAG = OLECMDID_OPTICAL_ZOOMFLAG(64i32); impl ::core::convert::From<i32> for OLECMDID_OPTICAL_ZOOMFLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDID_OPTICAL_ZOOMFLAG { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDID_PAGEACTIONFLAG(pub i32); pub const OLECMDIDF_PAGEACTION_FILEDOWNLOAD: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(1i32); pub const OLECMDIDF_PAGEACTION_ACTIVEXINSTALL: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(2i32); pub const OLECMDIDF_PAGEACTION_ACTIVEXTRUSTFAIL: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(4i32); pub const OLECMDIDF_PAGEACTION_ACTIVEXUSERDISABLE: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(8i32); pub const OLECMDIDF_PAGEACTION_ACTIVEXDISALLOW: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(16i32); pub const OLECMDIDF_PAGEACTION_ACTIVEXUNSAFE: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(32i32); pub const OLECMDIDF_PAGEACTION_POPUPWINDOW: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(64i32); pub const OLECMDIDF_PAGEACTION_LOCALMACHINE: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(128i32); pub const OLECMDIDF_PAGEACTION_MIMETEXTPLAIN: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(256i32); pub const OLECMDIDF_PAGEACTION_SCRIPTNAVIGATE: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(512i32); pub const OLECMDIDF_PAGEACTION_SCRIPTNAVIGATE_ACTIVEXINSTALL: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(512i32); pub const OLECMDIDF_PAGEACTION_PROTLOCKDOWNLOCALMACHINE: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(1024i32); pub const OLECMDIDF_PAGEACTION_PROTLOCKDOWNTRUSTED: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(2048i32); pub const OLECMDIDF_PAGEACTION_PROTLOCKDOWNINTRANET: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(4096i32); pub const OLECMDIDF_PAGEACTION_PROTLOCKDOWNINTERNET: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(8192i32); pub const OLECMDIDF_PAGEACTION_PROTLOCKDOWNRESTRICTED: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(16384i32); pub const OLECMDIDF_PAGEACTION_PROTLOCKDOWNDENY: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(32768i32); pub const OLECMDIDF_PAGEACTION_POPUPALLOWED: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(65536i32); pub const OLECMDIDF_PAGEACTION_SCRIPTPROMPT: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(131072i32); pub const OLECMDIDF_PAGEACTION_ACTIVEXUSERAPPROVAL: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(262144i32); pub const OLECMDIDF_PAGEACTION_MIXEDCONTENT: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(524288i32); pub const OLECMDIDF_PAGEACTION_INVALID_CERT: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(1048576i32); pub const OLECMDIDF_PAGEACTION_INTRANETZONEREQUEST: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(2097152i32); pub const OLECMDIDF_PAGEACTION_XSSFILTERED: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(4194304i32); pub const OLECMDIDF_PAGEACTION_SPOOFABLEIDNHOST: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(8388608i32); pub const OLECMDIDF_PAGEACTION_ACTIVEX_EPM_INCOMPATIBLE: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(16777216i32); pub const OLECMDIDF_PAGEACTION_SCRIPTNAVIGATE_ACTIVEXUSERAPPROVAL: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(33554432i32); pub const OLECMDIDF_PAGEACTION_WPCBLOCKED: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(67108864i32); pub const OLECMDIDF_PAGEACTION_WPCBLOCKED_ACTIVEX: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(134217728i32); pub const OLECMDIDF_PAGEACTION_EXTENSION_COMPAT_BLOCKED: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(268435456i32); pub const OLECMDIDF_PAGEACTION_NORESETACTIVEX: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(536870912i32); pub const OLECMDIDF_PAGEACTION_GENERIC_STATE: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(1073741824i32); pub const OLECMDIDF_PAGEACTION_RESET: OLECMDID_PAGEACTIONFLAG = OLECMDID_PAGEACTIONFLAG(-2147483648i32); impl ::core::convert::From<i32> for OLECMDID_PAGEACTIONFLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDID_PAGEACTIONFLAG { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDID_REFRESHFLAG(pub i32); pub const OLECMDIDF_REFRESH_NORMAL: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(0i32); pub const OLECMDIDF_REFRESH_IFEXPIRED: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(1i32); pub const OLECMDIDF_REFRESH_CONTINUE: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(2i32); pub const OLECMDIDF_REFRESH_COMPLETELY: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(3i32); pub const OLECMDIDF_REFRESH_NO_CACHE: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(4i32); pub const OLECMDIDF_REFRESH_RELOAD: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(5i32); pub const OLECMDIDF_REFRESH_LEVELMASK: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(255i32); pub const OLECMDIDF_REFRESH_CLEARUSERINPUT: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(4096i32); pub const OLECMDIDF_REFRESH_PROMPTIFOFFLINE: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(8192i32); pub const OLECMDIDF_REFRESH_THROUGHSCRIPT: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(16384i32); pub const OLECMDIDF_REFRESH_SKIPBEFOREUNLOADEVENT: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(32768i32); pub const OLECMDIDF_REFRESH_PAGEACTION_ACTIVEXINSTALL: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(65536i32); pub const OLECMDIDF_REFRESH_PAGEACTION_FILEDOWNLOAD: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(131072i32); pub const OLECMDIDF_REFRESH_PAGEACTION_LOCALMACHINE: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(262144i32); pub const OLECMDIDF_REFRESH_PAGEACTION_POPUPWINDOW: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(524288i32); pub const OLECMDIDF_REFRESH_PAGEACTION_PROTLOCKDOWNLOCALMACHINE: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(1048576i32); pub const OLECMDIDF_REFRESH_PAGEACTION_PROTLOCKDOWNTRUSTED: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(2097152i32); pub const OLECMDIDF_REFRESH_PAGEACTION_PROTLOCKDOWNINTRANET: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(4194304i32); pub const OLECMDIDF_REFRESH_PAGEACTION_PROTLOCKDOWNINTERNET: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(8388608i32); pub const OLECMDIDF_REFRESH_PAGEACTION_PROTLOCKDOWNRESTRICTED: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(16777216i32); pub const OLECMDIDF_REFRESH_PAGEACTION_MIXEDCONTENT: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(33554432i32); pub const OLECMDIDF_REFRESH_PAGEACTION_INVALID_CERT: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(67108864i32); pub const OLECMDIDF_REFRESH_PAGEACTION_ALLOW_VERSION: OLECMDID_REFRESHFLAG = OLECMDID_REFRESHFLAG(134217728i32); impl ::core::convert::From<i32> for OLECMDID_REFRESHFLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDID_REFRESHFLAG { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDID_VIEWPORT_MODE_FLAG(pub i32); pub const OLECMDIDF_VIEWPORTMODE_FIXED_LAYOUT_WIDTH: OLECMDID_VIEWPORT_MODE_FLAG = OLECMDID_VIEWPORT_MODE_FLAG(1i32); pub const OLECMDIDF_VIEWPORTMODE_EXCLUDE_VISUAL_BOTTOM: OLECMDID_VIEWPORT_MODE_FLAG = OLECMDID_VIEWPORT_MODE_FLAG(2i32); pub const OLECMDIDF_VIEWPORTMODE_FIXED_LAYOUT_WIDTH_VALID: OLECMDID_VIEWPORT_MODE_FLAG = OLECMDID_VIEWPORT_MODE_FLAG(65536i32); pub const OLECMDIDF_VIEWPORTMODE_EXCLUDE_VISUAL_BOTTOM_VALID: OLECMDID_VIEWPORT_MODE_FLAG = OLECMDID_VIEWPORT_MODE_FLAG(131072i32); impl ::core::convert::From<i32> for OLECMDID_VIEWPORT_MODE_FLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDID_VIEWPORT_MODE_FLAG { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDID_WINDOWSTATE_FLAG(pub i32); pub const OLECMDIDF_WINDOWSTATE_USERVISIBLE: OLECMDID_WINDOWSTATE_FLAG = OLECMDID_WINDOWSTATE_FLAG(1i32); pub const OLECMDIDF_WINDOWSTATE_ENABLED: OLECMDID_WINDOWSTATE_FLAG = OLECMDID_WINDOWSTATE_FLAG(2i32); pub const OLECMDIDF_WINDOWSTATE_USERVISIBLE_VALID: OLECMDID_WINDOWSTATE_FLAG = OLECMDID_WINDOWSTATE_FLAG(65536i32); pub const OLECMDIDF_WINDOWSTATE_ENABLED_VALID: OLECMDID_WINDOWSTATE_FLAG = OLECMDID_WINDOWSTATE_FLAG(131072i32); impl ::core::convert::From<i32> for OLECMDID_WINDOWSTATE_FLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDID_WINDOWSTATE_FLAG { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct OLECMDTEXT { pub cmdtextf: u32, pub cwActual: u32, pub cwBuf: u32, pub rgwz: [u16; 1], } impl OLECMDTEXT {} impl ::core::default::Default for OLECMDTEXT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for OLECMDTEXT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLECMDTEXT").field("cmdtextf", &self.cmdtextf).field("cwActual", &self.cwActual).field("cwBuf", &self.cwBuf).field("rgwz", &self.rgwz).finish() } } impl ::core::cmp::PartialEq for OLECMDTEXT { fn eq(&self, other: &Self) -> bool { self.cmdtextf == other.cmdtextf && self.cwActual == other.cwActual && self.cwBuf == other.cwBuf && self.rgwz == other.rgwz } } impl ::core::cmp::Eq for OLECMDTEXT {} unsafe impl ::windows::core::Abi for OLECMDTEXT { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECMDTEXTF(pub i32); pub const OLECMDTEXTF_NONE: OLECMDTEXTF = OLECMDTEXTF(0i32); pub const OLECMDTEXTF_NAME: OLECMDTEXTF = OLECMDTEXTF(1i32); pub const OLECMDTEXTF_STATUS: OLECMDTEXTF = OLECMDTEXTF(2i32); impl ::core::convert::From<i32> for OLECMDTEXTF { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECMDTEXTF { type Abi = Self; } pub const OLECMD_TASKDLGID_ONBEFOREUNLOAD: u32 = 1u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLECONTF(pub i32); pub const OLECONTF_EMBEDDINGS: OLECONTF = OLECONTF(1i32); pub const OLECONTF_LINKS: OLECONTF = OLECONTF(2i32); pub const OLECONTF_OTHERS: OLECONTF = OLECONTF(4i32); pub const OLECONTF_ONLYUSER: OLECONTF = OLECONTF(8i32); pub const OLECONTF_ONLYIFRUNNING: OLECONTF = OLECONTF(16i32); impl ::core::convert::From<i32> for OLECONTF { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLECONTF { type Abi = Self; } pub const OLECREATE_LEAVERUNNING: u32 = 1u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLEDCFLAGS(pub i32); pub const OLEDC_NODRAW: OLEDCFLAGS = OLEDCFLAGS(1i32); pub const OLEDC_PAINTBKGND: OLEDCFLAGS = OLEDCFLAGS(2i32); pub const OLEDC_OFFSCREEN: OLEDCFLAGS = OLEDCFLAGS(4i32); impl ::core::convert::From<i32> for OLEDCFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLEDCFLAGS { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLEGETMONIKER(pub i32); pub const OLEGETMONIKER_ONLYIFTHERE: OLEGETMONIKER = OLEGETMONIKER(1i32); pub const OLEGETMONIKER_FORCEASSIGN: OLEGETMONIKER = OLEGETMONIKER(2i32); pub const OLEGETMONIKER_UNASSIGN: OLEGETMONIKER = OLEGETMONIKER(3i32); pub const OLEGETMONIKER_TEMPFORUSER: OLEGETMONIKER = OLEGETMONIKER(4i32); impl ::core::convert::From<i32> for OLEGETMONIKER { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLEGETMONIKER { type Abi = Self; } pub const OLEIVERB_DISCARDUNDOSTATE: i32 = -6i32; pub const OLEIVERB_HIDE: i32 = -3i32; pub const OLEIVERB_INPLACEACTIVATE: i32 = -5i32; pub const OLEIVERB_OPEN: i32 = -2i32; pub const OLEIVERB_PRIMARY: i32 = 0i32; pub const OLEIVERB_PROPERTIES: i32 = -7i32; pub const OLEIVERB_SHOW: i32 = -1i32; pub const OLEIVERB_UIACTIVATE: i32 = -4i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLELINKBIND(pub i32); pub const OLELINKBIND_EVENIFCLASSDIFF: OLELINKBIND = OLELINKBIND(1i32); impl ::core::convert::From<i32> for OLELINKBIND { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLELINKBIND { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLEMISC(pub i32); pub const OLEMISC_RECOMPOSEONRESIZE: OLEMISC = OLEMISC(1i32); pub const OLEMISC_ONLYICONIC: OLEMISC = OLEMISC(2i32); pub const OLEMISC_INSERTNOTREPLACE: OLEMISC = OLEMISC(4i32); pub const OLEMISC_STATIC: OLEMISC = OLEMISC(8i32); pub const OLEMISC_CANTLINKINSIDE: OLEMISC = OLEMISC(16i32); pub const OLEMISC_CANLINKBYOLE1: OLEMISC = OLEMISC(32i32); pub const OLEMISC_ISLINKOBJECT: OLEMISC = OLEMISC(64i32); pub const OLEMISC_INSIDEOUT: OLEMISC = OLEMISC(128i32); pub const OLEMISC_ACTIVATEWHENVISIBLE: OLEMISC = OLEMISC(256i32); pub const OLEMISC_RENDERINGISDEVICEINDEPENDENT: OLEMISC = OLEMISC(512i32); pub const OLEMISC_INVISIBLEATRUNTIME: OLEMISC = OLEMISC(1024i32); pub const OLEMISC_ALWAYSRUN: OLEMISC = OLEMISC(2048i32); pub const OLEMISC_ACTSLIKEBUTTON: OLEMISC = OLEMISC(4096i32); pub const OLEMISC_ACTSLIKELABEL: OLEMISC = OLEMISC(8192i32); pub const OLEMISC_NOUIACTIVATE: OLEMISC = OLEMISC(16384i32); pub const OLEMISC_ALIGNABLE: OLEMISC = OLEMISC(32768i32); pub const OLEMISC_SIMPLEFRAME: OLEMISC = OLEMISC(65536i32); pub const OLEMISC_SETCLIENTSITEFIRST: OLEMISC = OLEMISC(131072i32); pub const OLEMISC_IMEMODE: OLEMISC = OLEMISC(262144i32); pub const OLEMISC_IGNOREACTIVATEWHENVISIBLE: OLEMISC = OLEMISC(524288i32); pub const OLEMISC_WANTSTOMENUMERGE: OLEMISC = OLEMISC(1048576i32); pub const OLEMISC_SUPPORTSMULTILEVELUNDO: OLEMISC = OLEMISC(2097152i32); impl ::core::convert::From<i32> for OLEMISC { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLEMISC { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLERENDER(pub i32); pub const OLERENDER_NONE: OLERENDER = OLERENDER(0i32); pub const OLERENDER_DRAW: OLERENDER = OLERENDER(1i32); pub const OLERENDER_FORMAT: OLERENDER = OLERENDER(2i32); pub const OLERENDER_ASIS: OLERENDER = OLERENDER(3i32); impl ::core::convert::From<i32> for OLERENDER { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLERENDER { type Abi = Self; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] pub struct OLEUIBUSYA { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PSTR, pub hResource: super::super::Foundation::HRSRC, pub hTask: super::super::Media::HTASK, pub lphWndDialog: *mut super::super::Foundation::HWND, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl OLEUIBUSYA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::default::Default for OLEUIBUSYA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::fmt::Debug for OLEUIBUSYA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIBUSYA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("hTask", &self.hTask) .field("lphWndDialog", &self.lphWndDialog) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::cmp::PartialEq for OLEUIBUSYA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.hTask == other.hTask && self.lphWndDialog == other.lphWndDialog } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::cmp::Eq for OLEUIBUSYA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] unsafe impl ::windows::core::Abi for OLEUIBUSYA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] pub struct OLEUIBUSYW { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PWSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PWSTR, pub hResource: super::super::Foundation::HRSRC, pub hTask: super::super::Media::HTASK, pub lphWndDialog: *mut super::super::Foundation::HWND, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl OLEUIBUSYW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::default::Default for OLEUIBUSYW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::fmt::Debug for OLEUIBUSYW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIBUSYW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("hTask", &self.hTask) .field("lphWndDialog", &self.lphWndDialog) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::cmp::PartialEq for OLEUIBUSYW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.hTask == other.hTask && self.lphWndDialog == other.lphWndDialog } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] impl ::core::cmp::Eq for OLEUIBUSYW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] unsafe impl ::windows::core::Abi for OLEUIBUSYW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OLEUICHANGEICONA { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PSTR, pub hResource: super::super::Foundation::HRSRC, pub hMetaPict: isize, pub clsid: ::windows::core::GUID, pub szIconExe: [super::super::Foundation::CHAR; 260], pub cchIconExe: i32, } #[cfg(feature = "Win32_Foundation")] impl OLEUICHANGEICONA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OLEUICHANGEICONA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OLEUICHANGEICONA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUICHANGEICONA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("hMetaPict", &self.hMetaPict) .field("clsid", &self.clsid) .field("szIconExe", &self.szIconExe) .field("cchIconExe", &self.cchIconExe) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OLEUICHANGEICONA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.hMetaPict == other.hMetaPict && self.clsid == other.clsid && self.szIconExe == other.szIconExe && self.cchIconExe == other.cchIconExe } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OLEUICHANGEICONA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OLEUICHANGEICONA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OLEUICHANGEICONW { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PWSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PWSTR, pub hResource: super::super::Foundation::HRSRC, pub hMetaPict: isize, pub clsid: ::windows::core::GUID, pub szIconExe: [u16; 260], pub cchIconExe: i32, } #[cfg(feature = "Win32_Foundation")] impl OLEUICHANGEICONW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OLEUICHANGEICONW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OLEUICHANGEICONW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUICHANGEICONW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("hMetaPict", &self.hMetaPict) .field("clsid", &self.clsid) .field("szIconExe", &self.szIconExe) .field("cchIconExe", &self.cchIconExe) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OLEUICHANGEICONW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.hMetaPict == other.hMetaPict && self.clsid == other.clsid && self.szIconExe == other.szIconExe && self.cchIconExe == other.cchIconExe } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OLEUICHANGEICONW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OLEUICHANGEICONW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] pub struct OLEUICHANGESOURCEA { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PSTR, pub hResource: super::super::Foundation::HRSRC, pub lpOFN: *mut super::super::UI::Controls::Dialogs::OPENFILENAMEA, pub dwReserved1: [u32; 4], pub lpOleUILinkContainer: ::core::option::Option<IOleUILinkContainerA>, pub dwLink: u32, pub lpszDisplayName: super::super::Foundation::PSTR, pub nFileLength: u32, pub lpszFrom: super::super::Foundation::PSTR, pub lpszTo: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl OLEUICHANGESOURCEA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::default::Default for OLEUICHANGESOURCEA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::fmt::Debug for OLEUICHANGESOURCEA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUICHANGESOURCEA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("lpOFN", &self.lpOFN) .field("dwReserved1", &self.dwReserved1) .field("lpOleUILinkContainer", &self.lpOleUILinkContainer) .field("dwLink", &self.dwLink) .field("lpszDisplayName", &self.lpszDisplayName) .field("nFileLength", &self.nFileLength) .field("lpszFrom", &self.lpszFrom) .field("lpszTo", &self.lpszTo) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::cmp::PartialEq for OLEUICHANGESOURCEA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.lpOFN == other.lpOFN && self.dwReserved1 == other.dwReserved1 && self.lpOleUILinkContainer == other.lpOleUILinkContainer && self.dwLink == other.dwLink && self.lpszDisplayName == other.lpszDisplayName && self.nFileLength == other.nFileLength && self.lpszFrom == other.lpszFrom && self.lpszTo == other.lpszTo } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::cmp::Eq for OLEUICHANGESOURCEA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] unsafe impl ::windows::core::Abi for OLEUICHANGESOURCEA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] pub struct OLEUICHANGESOURCEW { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PWSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PWSTR, pub hResource: super::super::Foundation::HRSRC, pub lpOFN: *mut super::super::UI::Controls::Dialogs::OPENFILENAMEW, pub dwReserved1: [u32; 4], pub lpOleUILinkContainer: ::core::option::Option<IOleUILinkContainerW>, pub dwLink: u32, pub lpszDisplayName: super::super::Foundation::PWSTR, pub nFileLength: u32, pub lpszFrom: super::super::Foundation::PWSTR, pub lpszTo: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl OLEUICHANGESOURCEW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::default::Default for OLEUICHANGESOURCEW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::fmt::Debug for OLEUICHANGESOURCEW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUICHANGESOURCEW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("lpOFN", &self.lpOFN) .field("dwReserved1", &self.dwReserved1) .field("lpOleUILinkContainer", &self.lpOleUILinkContainer) .field("dwLink", &self.dwLink) .field("lpszDisplayName", &self.lpszDisplayName) .field("nFileLength", &self.nFileLength) .field("lpszFrom", &self.lpszFrom) .field("lpszTo", &self.lpszTo) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::cmp::PartialEq for OLEUICHANGESOURCEW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.lpOFN == other.lpOFN && self.dwReserved1 == other.dwReserved1 && self.lpOleUILinkContainer == other.lpOleUILinkContainer && self.dwLink == other.dwLink && self.lpszDisplayName == other.lpszDisplayName && self.nFileLength == other.nFileLength && self.lpszFrom == other.lpszFrom && self.lpszTo == other.lpszTo } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] impl ::core::cmp::Eq for OLEUICHANGESOURCEW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] unsafe impl ::windows::core::Abi for OLEUICHANGESOURCEW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OLEUICONVERTA { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PSTR, pub hResource: super::super::Foundation::HRSRC, pub clsid: ::windows::core::GUID, pub clsidConvertDefault: ::windows::core::GUID, pub clsidActivateDefault: ::windows::core::GUID, pub clsidNew: ::windows::core::GUID, pub dvAspect: u32, pub wFormat: u16, pub fIsLinkedObject: super::super::Foundation::BOOL, pub hMetaPict: isize, pub lpszUserType: super::super::Foundation::PSTR, pub fObjectsIconChanged: super::super::Foundation::BOOL, pub lpszDefLabel: super::super::Foundation::PSTR, pub cClsidExclude: u32, pub lpClsidExclude: *mut ::windows::core::GUID, } #[cfg(feature = "Win32_Foundation")] impl OLEUICONVERTA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OLEUICONVERTA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OLEUICONVERTA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUICONVERTA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("clsid", &self.clsid) .field("clsidConvertDefault", &self.clsidConvertDefault) .field("clsidActivateDefault", &self.clsidActivateDefault) .field("clsidNew", &self.clsidNew) .field("dvAspect", &self.dvAspect) .field("wFormat", &self.wFormat) .field("fIsLinkedObject", &self.fIsLinkedObject) .field("hMetaPict", &self.hMetaPict) .field("lpszUserType", &self.lpszUserType) .field("fObjectsIconChanged", &self.fObjectsIconChanged) .field("lpszDefLabel", &self.lpszDefLabel) .field("cClsidExclude", &self.cClsidExclude) .field("lpClsidExclude", &self.lpClsidExclude) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OLEUICONVERTA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.clsid == other.clsid && self.clsidConvertDefault == other.clsidConvertDefault && self.clsidActivateDefault == other.clsidActivateDefault && self.clsidNew == other.clsidNew && self.dvAspect == other.dvAspect && self.wFormat == other.wFormat && self.fIsLinkedObject == other.fIsLinkedObject && self.hMetaPict == other.hMetaPict && self.lpszUserType == other.lpszUserType && self.fObjectsIconChanged == other.fObjectsIconChanged && self.lpszDefLabel == other.lpszDefLabel && self.cClsidExclude == other.cClsidExclude && self.lpClsidExclude == other.lpClsidExclude } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OLEUICONVERTA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OLEUICONVERTA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OLEUICONVERTW { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PWSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PWSTR, pub hResource: super::super::Foundation::HRSRC, pub clsid: ::windows::core::GUID, pub clsidConvertDefault: ::windows::core::GUID, pub clsidActivateDefault: ::windows::core::GUID, pub clsidNew: ::windows::core::GUID, pub dvAspect: u32, pub wFormat: u16, pub fIsLinkedObject: super::super::Foundation::BOOL, pub hMetaPict: isize, pub lpszUserType: super::super::Foundation::PWSTR, pub fObjectsIconChanged: super::super::Foundation::BOOL, pub lpszDefLabel: super::super::Foundation::PWSTR, pub cClsidExclude: u32, pub lpClsidExclude: *mut ::windows::core::GUID, } #[cfg(feature = "Win32_Foundation")] impl OLEUICONVERTW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OLEUICONVERTW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OLEUICONVERTW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUICONVERTW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("clsid", &self.clsid) .field("clsidConvertDefault", &self.clsidConvertDefault) .field("clsidActivateDefault", &self.clsidActivateDefault) .field("clsidNew", &self.clsidNew) .field("dvAspect", &self.dvAspect) .field("wFormat", &self.wFormat) .field("fIsLinkedObject", &self.fIsLinkedObject) .field("hMetaPict", &self.hMetaPict) .field("lpszUserType", &self.lpszUserType) .field("fObjectsIconChanged", &self.fObjectsIconChanged) .field("lpszDefLabel", &self.lpszDefLabel) .field("cClsidExclude", &self.cClsidExclude) .field("lpClsidExclude", &self.lpClsidExclude) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OLEUICONVERTW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.clsid == other.clsid && self.clsidConvertDefault == other.clsidConvertDefault && self.clsidActivateDefault == other.clsidActivateDefault && self.clsidNew == other.clsidNew && self.dvAspect == other.dvAspect && self.wFormat == other.wFormat && self.fIsLinkedObject == other.fIsLinkedObject && self.hMetaPict == other.hMetaPict && self.lpszUserType == other.lpszUserType && self.fObjectsIconChanged == other.fObjectsIconChanged && self.lpszDefLabel == other.lpszDefLabel && self.cClsidExclude == other.cClsidExclude && self.lpClsidExclude == other.lpClsidExclude } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OLEUICONVERTW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OLEUICONVERTW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OLEUIEDITLINKSA { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PSTR, pub hResource: super::super::Foundation::HRSRC, pub lpOleUILinkContainer: ::core::option::Option<IOleUILinkContainerA>, } #[cfg(feature = "Win32_Foundation")] impl OLEUIEDITLINKSA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OLEUIEDITLINKSA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OLEUIEDITLINKSA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIEDITLINKSA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("lpOleUILinkContainer", &self.lpOleUILinkContainer) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OLEUIEDITLINKSA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.lpOleUILinkContainer == other.lpOleUILinkContainer } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OLEUIEDITLINKSA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OLEUIEDITLINKSA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OLEUIEDITLINKSW { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PWSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PWSTR, pub hResource: super::super::Foundation::HRSRC, pub lpOleUILinkContainer: ::core::option::Option<IOleUILinkContainerW>, } #[cfg(feature = "Win32_Foundation")] impl OLEUIEDITLINKSW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OLEUIEDITLINKSW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OLEUIEDITLINKSW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIEDITLINKSW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("lpOleUILinkContainer", &self.lpOleUILinkContainer) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OLEUIEDITLINKSW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.lpOleUILinkContainer == other.lpOleUILinkContainer } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OLEUIEDITLINKSW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OLEUIEDITLINKSW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUIGNRLPROPSA { pub cbStruct: u32, pub dwFlags: u32, pub dwReserved1: [u32; 2], pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub dwReserved2: [u32; 3], pub lpOP: *mut OLEUIOBJECTPROPSA, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUIGNRLPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUIGNRLPROPSA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUIGNRLPROPSA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIGNRLPROPSA").field("cbStruct", &self.cbStruct).field("dwFlags", &self.dwFlags).field("dwReserved1", &self.dwReserved1).field("lCustData", &self.lCustData).field("dwReserved2", &self.dwReserved2).field("lpOP", &self.lpOP).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUIGNRLPROPSA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.dwReserved1 == other.dwReserved1 && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.dwReserved2 == other.dwReserved2 && self.lpOP == other.lpOP } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUIGNRLPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUIGNRLPROPSA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUIGNRLPROPSW { pub cbStruct: u32, pub dwFlags: u32, pub dwReserved1: [u32; 2], pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub dwReserved2: [u32; 3], pub lpOP: *mut OLEUIOBJECTPROPSW, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUIGNRLPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUIGNRLPROPSW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUIGNRLPROPSW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIGNRLPROPSW").field("cbStruct", &self.cbStruct).field("dwFlags", &self.dwFlags).field("dwReserved1", &self.dwReserved1).field("lCustData", &self.lCustData).field("dwReserved2", &self.dwReserved2).field("lpOP", &self.lpOP).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUIGNRLPROPSW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.dwReserved1 == other.dwReserved1 && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.dwReserved2 == other.dwReserved2 && self.lpOP == other.lpOP } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUIGNRLPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUIGNRLPROPSW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub struct OLEUIINSERTOBJECTA { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PSTR, pub hResource: super::super::Foundation::HRSRC, pub clsid: ::windows::core::GUID, pub lpszFile: super::super::Foundation::PSTR, pub cchFile: u32, pub cClsidExclude: u32, pub lpClsidExclude: *mut ::windows::core::GUID, pub iid: ::windows::core::GUID, pub oleRender: u32, pub lpFormatEtc: *mut super::Com::FORMATETC, pub lpIOleClientSite: ::core::option::Option<IOleClientSite>, pub lpIStorage: ::core::option::Option<super::Com::StructuredStorage::IStorage>, pub ppvObj: *mut *mut ::core::ffi::c_void, pub sc: i32, pub hMetaPict: isize, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl OLEUIINSERTOBJECTA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::default::Default for OLEUIINSERTOBJECTA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::fmt::Debug for OLEUIINSERTOBJECTA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIINSERTOBJECTA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("clsid", &self.clsid) .field("lpszFile", &self.lpszFile) .field("cchFile", &self.cchFile) .field("cClsidExclude", &self.cClsidExclude) .field("lpClsidExclude", &self.lpClsidExclude) .field("iid", &self.iid) .field("oleRender", &self.oleRender) .field("lpFormatEtc", &self.lpFormatEtc) .field("lpIOleClientSite", &self.lpIOleClientSite) .field("lpIStorage", &self.lpIStorage) .field("ppvObj", &self.ppvObj) .field("sc", &self.sc) .field("hMetaPict", &self.hMetaPict) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::cmp::PartialEq for OLEUIINSERTOBJECTA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.clsid == other.clsid && self.lpszFile == other.lpszFile && self.cchFile == other.cchFile && self.cClsidExclude == other.cClsidExclude && self.lpClsidExclude == other.lpClsidExclude && self.iid == other.iid && self.oleRender == other.oleRender && self.lpFormatEtc == other.lpFormatEtc && self.lpIOleClientSite == other.lpIOleClientSite && self.lpIStorage == other.lpIStorage && self.ppvObj == other.ppvObj && self.sc == other.sc && self.hMetaPict == other.hMetaPict } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::cmp::Eq for OLEUIINSERTOBJECTA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] unsafe impl ::windows::core::Abi for OLEUIINSERTOBJECTA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] pub struct OLEUIINSERTOBJECTW { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PWSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PWSTR, pub hResource: super::super::Foundation::HRSRC, pub clsid: ::windows::core::GUID, pub lpszFile: super::super::Foundation::PWSTR, pub cchFile: u32, pub cClsidExclude: u32, pub lpClsidExclude: *mut ::windows::core::GUID, pub iid: ::windows::core::GUID, pub oleRender: u32, pub lpFormatEtc: *mut super::Com::FORMATETC, pub lpIOleClientSite: ::core::option::Option<IOleClientSite>, pub lpIStorage: ::core::option::Option<super::Com::StructuredStorage::IStorage>, pub ppvObj: *mut *mut ::core::ffi::c_void, pub sc: i32, pub hMetaPict: isize, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl OLEUIINSERTOBJECTW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::default::Default for OLEUIINSERTOBJECTW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::fmt::Debug for OLEUIINSERTOBJECTW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIINSERTOBJECTW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("clsid", &self.clsid) .field("lpszFile", &self.lpszFile) .field("cchFile", &self.cchFile) .field("cClsidExclude", &self.cClsidExclude) .field("lpClsidExclude", &self.lpClsidExclude) .field("iid", &self.iid) .field("oleRender", &self.oleRender) .field("lpFormatEtc", &self.lpFormatEtc) .field("lpIOleClientSite", &self.lpIOleClientSite) .field("lpIStorage", &self.lpIStorage) .field("ppvObj", &self.ppvObj) .field("sc", &self.sc) .field("hMetaPict", &self.hMetaPict) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::cmp::PartialEq for OLEUIINSERTOBJECTW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.clsid == other.clsid && self.lpszFile == other.lpszFile && self.cchFile == other.cchFile && self.cClsidExclude == other.cClsidExclude && self.lpClsidExclude == other.lpClsidExclude && self.iid == other.iid && self.oleRender == other.oleRender && self.lpFormatEtc == other.lpFormatEtc && self.lpIOleClientSite == other.lpIOleClientSite && self.lpIStorage == other.lpIStorage && self.ppvObj == other.ppvObj && self.sc == other.sc && self.hMetaPict == other.hMetaPict } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] impl ::core::cmp::Eq for OLEUIINSERTOBJECTW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] unsafe impl ::windows::core::Abi for OLEUIINSERTOBJECTW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUILINKPROPSA { pub cbStruct: u32, pub dwFlags: u32, pub dwReserved1: [u32; 2], pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub dwReserved2: [u32; 3], pub lpOP: *mut OLEUIOBJECTPROPSA, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUILINKPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUILINKPROPSA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUILINKPROPSA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUILINKPROPSA").field("cbStruct", &self.cbStruct).field("dwFlags", &self.dwFlags).field("dwReserved1", &self.dwReserved1).field("lCustData", &self.lCustData).field("dwReserved2", &self.dwReserved2).field("lpOP", &self.lpOP).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUILINKPROPSA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.dwReserved1 == other.dwReserved1 && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.dwReserved2 == other.dwReserved2 && self.lpOP == other.lpOP } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUILINKPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUILINKPROPSA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUILINKPROPSW { pub cbStruct: u32, pub dwFlags: u32, pub dwReserved1: [u32; 2], pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub dwReserved2: [u32; 3], pub lpOP: *mut OLEUIOBJECTPROPSW, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUILINKPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUILINKPROPSW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUILINKPROPSW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUILINKPROPSW").field("cbStruct", &self.cbStruct).field("dwFlags", &self.dwFlags).field("dwReserved1", &self.dwReserved1).field("lCustData", &self.lCustData).field("dwReserved2", &self.dwReserved2).field("lpOP", &self.lpOP).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUILINKPROPSW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.dwReserved1 == other.dwReserved1 && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.dwReserved2 == other.dwReserved2 && self.lpOP == other.lpOP } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUILINKPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUILINKPROPSW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUIOBJECTPROPSA { pub cbStruct: u32, pub dwFlags: u32, pub lpPS: *mut super::super::UI::Controls::PROPSHEETHEADERA_V2, pub dwObject: u32, pub lpObjInfo: ::core::option::Option<IOleUIObjInfoA>, pub dwLink: u32, pub lpLinkInfo: ::core::option::Option<IOleUILinkInfoA>, pub lpGP: *mut OLEUIGNRLPROPSA, pub lpVP: *mut OLEUIVIEWPROPSA, pub lpLP: *mut OLEUILINKPROPSA, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUIOBJECTPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUIOBJECTPROPSA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUIOBJECTPROPSA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIOBJECTPROPSA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("lpPS", &self.lpPS) .field("dwObject", &self.dwObject) .field("lpObjInfo", &self.lpObjInfo) .field("dwLink", &self.dwLink) .field("lpLinkInfo", &self.lpLinkInfo) .field("lpGP", &self.lpGP) .field("lpVP", &self.lpVP) .field("lpLP", &self.lpLP) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUIOBJECTPROPSA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.lpPS == other.lpPS && self.dwObject == other.dwObject && self.lpObjInfo == other.lpObjInfo && self.dwLink == other.dwLink && self.lpLinkInfo == other.lpLinkInfo && self.lpGP == other.lpGP && self.lpVP == other.lpVP && self.lpLP == other.lpLP } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUIOBJECTPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUIOBJECTPROPSA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUIOBJECTPROPSW { pub cbStruct: u32, pub dwFlags: u32, pub lpPS: *mut super::super::UI::Controls::PROPSHEETHEADERW_V2, pub dwObject: u32, pub lpObjInfo: ::core::option::Option<IOleUIObjInfoW>, pub dwLink: u32, pub lpLinkInfo: ::core::option::Option<IOleUILinkInfoW>, pub lpGP: *mut OLEUIGNRLPROPSW, pub lpVP: *mut OLEUIVIEWPROPSW, pub lpLP: *mut OLEUILINKPROPSW, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUIOBJECTPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUIOBJECTPROPSW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUIOBJECTPROPSW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIOBJECTPROPSW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("lpPS", &self.lpPS) .field("dwObject", &self.dwObject) .field("lpObjInfo", &self.lpObjInfo) .field("dwLink", &self.dwLink) .field("lpLinkInfo", &self.lpLinkInfo) .field("lpGP", &self.lpGP) .field("lpVP", &self.lpVP) .field("lpLP", &self.lpLP) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUIOBJECTPROPSW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.lpPS == other.lpPS && self.dwObject == other.dwObject && self.lpObjInfo == other.lpObjInfo && self.dwLink == other.dwLink && self.lpLinkInfo == other.lpLinkInfo && self.lpGP == other.lpGP && self.lpVP == other.lpVP && self.lpLP == other.lpLP } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUIOBJECTPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUIOBJECTPROPSW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct OLEUIPASTEENTRYA { pub fmtetc: super::Com::FORMATETC, pub lpstrFormatName: super::super::Foundation::PSTR, pub lpstrResultText: super::super::Foundation::PSTR, pub dwFlags: u32, pub dwScratchSpace: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl OLEUIPASTEENTRYA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for OLEUIPASTEENTRYA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for OLEUIPASTEENTRYA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIPASTEENTRYA").field("fmtetc", &self.fmtetc).field("lpstrFormatName", &self.lpstrFormatName).field("lpstrResultText", &self.lpstrResultText).field("dwFlags", &self.dwFlags).field("dwScratchSpace", &self.dwScratchSpace).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for OLEUIPASTEENTRYA { fn eq(&self, other: &Self) -> bool { self.fmtetc == other.fmtetc && self.lpstrFormatName == other.lpstrFormatName && self.lpstrResultText == other.lpstrResultText && self.dwFlags == other.dwFlags && self.dwScratchSpace == other.dwScratchSpace } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for OLEUIPASTEENTRYA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for OLEUIPASTEENTRYA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct OLEUIPASTEENTRYW { pub fmtetc: super::Com::FORMATETC, pub lpstrFormatName: super::super::Foundation::PWSTR, pub lpstrResultText: super::super::Foundation::PWSTR, pub dwFlags: u32, pub dwScratchSpace: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl OLEUIPASTEENTRYW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for OLEUIPASTEENTRYW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for OLEUIPASTEENTRYW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIPASTEENTRYW").field("fmtetc", &self.fmtetc).field("lpstrFormatName", &self.lpstrFormatName).field("lpstrResultText", &self.lpstrResultText).field("dwFlags", &self.dwFlags).field("dwScratchSpace", &self.dwScratchSpace).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for OLEUIPASTEENTRYW { fn eq(&self, other: &Self) -> bool { self.fmtetc == other.fmtetc && self.lpstrFormatName == other.lpstrFormatName && self.lpstrResultText == other.lpstrResultText && self.dwFlags == other.dwFlags && self.dwScratchSpace == other.dwScratchSpace } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for OLEUIPASTEENTRYW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for OLEUIPASTEENTRYW { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLEUIPASTEFLAG(pub i32); pub const OLEUIPASTE_ENABLEICON: OLEUIPASTEFLAG = OLEUIPASTEFLAG(2048i32); pub const OLEUIPASTE_PASTEONLY: OLEUIPASTEFLAG = OLEUIPASTEFLAG(0i32); pub const OLEUIPASTE_PASTE: OLEUIPASTEFLAG = OLEUIPASTEFLAG(512i32); pub const OLEUIPASTE_LINKANYTYPE: OLEUIPASTEFLAG = OLEUIPASTEFLAG(1024i32); pub const OLEUIPASTE_LINKTYPE1: OLEUIPASTEFLAG = OLEUIPASTEFLAG(1i32); pub const OLEUIPASTE_LINKTYPE2: OLEUIPASTEFLAG = OLEUIPASTEFLAG(2i32); pub const OLEUIPASTE_LINKTYPE3: OLEUIPASTEFLAG = OLEUIPASTEFLAG(4i32); pub const OLEUIPASTE_LINKTYPE4: OLEUIPASTEFLAG = OLEUIPASTEFLAG(8i32); pub const OLEUIPASTE_LINKTYPE5: OLEUIPASTEFLAG = OLEUIPASTEFLAG(16i32); pub const OLEUIPASTE_LINKTYPE6: OLEUIPASTEFLAG = OLEUIPASTEFLAG(32i32); pub const OLEUIPASTE_LINKTYPE7: OLEUIPASTEFLAG = OLEUIPASTEFLAG(64i32); pub const OLEUIPASTE_LINKTYPE8: OLEUIPASTEFLAG = OLEUIPASTEFLAG(128i32); impl ::core::convert::From<i32> for OLEUIPASTEFLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLEUIPASTEFLAG { type Abi = Self; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct OLEUIPASTESPECIALA { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PSTR, pub hResource: super::super::Foundation::HRSRC, pub lpSrcDataObj: ::core::option::Option<super::Com::IDataObject>, pub arrPasteEntries: *mut OLEUIPASTEENTRYA, pub cPasteEntries: i32, pub arrLinkTypes: *mut u32, pub cLinkTypes: i32, pub cClsidExclude: u32, pub lpClsidExclude: *mut ::windows::core::GUID, pub nSelectedIndex: i32, pub fLink: super::super::Foundation::BOOL, pub hMetaPict: isize, pub sizel: super::super::Foundation::SIZE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl OLEUIPASTESPECIALA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for OLEUIPASTESPECIALA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for OLEUIPASTESPECIALA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIPASTESPECIALA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("lpSrcDataObj", &self.lpSrcDataObj) .field("arrPasteEntries", &self.arrPasteEntries) .field("cPasteEntries", &self.cPasteEntries) .field("arrLinkTypes", &self.arrLinkTypes) .field("cLinkTypes", &self.cLinkTypes) .field("cClsidExclude", &self.cClsidExclude) .field("lpClsidExclude", &self.lpClsidExclude) .field("nSelectedIndex", &self.nSelectedIndex) .field("fLink", &self.fLink) .field("hMetaPict", &self.hMetaPict) .field("sizel", &self.sizel) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for OLEUIPASTESPECIALA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.lpSrcDataObj == other.lpSrcDataObj && self.arrPasteEntries == other.arrPasteEntries && self.cPasteEntries == other.cPasteEntries && self.arrLinkTypes == other.arrLinkTypes && self.cLinkTypes == other.cLinkTypes && self.cClsidExclude == other.cClsidExclude && self.lpClsidExclude == other.lpClsidExclude && self.nSelectedIndex == other.nSelectedIndex && self.fLink == other.fLink && self.hMetaPict == other.hMetaPict && self.sizel == other.sizel } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for OLEUIPASTESPECIALA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for OLEUIPASTESPECIALA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct OLEUIPASTESPECIALW { pub cbStruct: u32, pub dwFlags: u32, pub hWndOwner: super::super::Foundation::HWND, pub lpszCaption: super::super::Foundation::PWSTR, pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub hInstance: super::super::Foundation::HINSTANCE, pub lpszTemplate: super::super::Foundation::PWSTR, pub hResource: super::super::Foundation::HRSRC, pub lpSrcDataObj: ::core::option::Option<super::Com::IDataObject>, pub arrPasteEntries: *mut OLEUIPASTEENTRYW, pub cPasteEntries: i32, pub arrLinkTypes: *mut u32, pub cLinkTypes: i32, pub cClsidExclude: u32, pub lpClsidExclude: *mut ::windows::core::GUID, pub nSelectedIndex: i32, pub fLink: super::super::Foundation::BOOL, pub hMetaPict: isize, pub sizel: super::super::Foundation::SIZE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl OLEUIPASTESPECIALW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for OLEUIPASTESPECIALW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for OLEUIPASTESPECIALW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIPASTESPECIALW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("hWndOwner", &self.hWndOwner) .field("lpszCaption", &self.lpszCaption) .field("lCustData", &self.lCustData) .field("hInstance", &self.hInstance) .field("lpszTemplate", &self.lpszTemplate) .field("hResource", &self.hResource) .field("lpSrcDataObj", &self.lpSrcDataObj) .field("arrPasteEntries", &self.arrPasteEntries) .field("cPasteEntries", &self.cPasteEntries) .field("arrLinkTypes", &self.arrLinkTypes) .field("cLinkTypes", &self.cLinkTypes) .field("cClsidExclude", &self.cClsidExclude) .field("lpClsidExclude", &self.lpClsidExclude) .field("nSelectedIndex", &self.nSelectedIndex) .field("fLink", &self.fLink) .field("hMetaPict", &self.hMetaPict) .field("sizel", &self.sizel) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for OLEUIPASTESPECIALW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.hWndOwner == other.hWndOwner && self.lpszCaption == other.lpszCaption && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.hInstance == other.hInstance && self.lpszTemplate == other.lpszTemplate && self.hResource == other.hResource && self.lpSrcDataObj == other.lpSrcDataObj && self.arrPasteEntries == other.arrPasteEntries && self.cPasteEntries == other.cPasteEntries && self.arrLinkTypes == other.arrLinkTypes && self.cLinkTypes == other.cLinkTypes && self.cClsidExclude == other.cClsidExclude && self.lpClsidExclude == other.lpClsidExclude && self.nSelectedIndex == other.nSelectedIndex && self.fLink == other.fLink && self.hMetaPict == other.hMetaPict && self.sizel == other.sizel } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for OLEUIPASTESPECIALW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for OLEUIPASTESPECIALW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUIVIEWPROPSA { pub cbStruct: u32, pub dwFlags: u32, pub dwReserved1: [u32; 2], pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub dwReserved2: [u32; 3], pub lpOP: *mut OLEUIOBJECTPROPSA, pub nScaleMin: i32, pub nScaleMax: i32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUIVIEWPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUIVIEWPROPSA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUIVIEWPROPSA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIVIEWPROPSA") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("dwReserved1", &self.dwReserved1) .field("lCustData", &self.lCustData) .field("dwReserved2", &self.dwReserved2) .field("lpOP", &self.lpOP) .field("nScaleMin", &self.nScaleMin) .field("nScaleMax", &self.nScaleMax) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUIVIEWPROPSA { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.dwReserved1 == other.dwReserved1 && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.dwReserved2 == other.dwReserved2 && self.lpOP == other.lpOP && self.nScaleMin == other.nScaleMin && self.nScaleMax == other.nScaleMax } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUIVIEWPROPSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUIVIEWPROPSA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] pub struct OLEUIVIEWPROPSW { pub cbStruct: u32, pub dwFlags: u32, pub dwReserved1: [u32; 2], pub lpfnHook: ::core::option::Option<LPFNOLEUIHOOK>, pub lCustData: super::super::Foundation::LPARAM, pub dwReserved2: [u32; 3], pub lpOP: *mut OLEUIOBJECTPROPSW, pub nScaleMin: i32, pub nScaleMax: i32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl OLEUIVIEWPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for OLEUIVIEWPROPSW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for OLEUIVIEWPROPSW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEUIVIEWPROPSW") .field("cbStruct", &self.cbStruct) .field("dwFlags", &self.dwFlags) .field("dwReserved1", &self.dwReserved1) .field("lCustData", &self.lCustData) .field("dwReserved2", &self.dwReserved2) .field("lpOP", &self.lpOP) .field("nScaleMin", &self.nScaleMin) .field("nScaleMax", &self.nScaleMax) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for OLEUIVIEWPROPSW { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.dwFlags == other.dwFlags && self.dwReserved1 == other.dwReserved1 && self.lpfnHook.map(|f| f as usize) == other.lpfnHook.map(|f| f as usize) && self.lCustData == other.lCustData && self.dwReserved2 == other.dwReserved2 && self.lpOP == other.lpOP && self.nScaleMin == other.nScaleMin && self.nScaleMax == other.nScaleMax } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for OLEUIVIEWPROPSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for OLEUIVIEWPROPSW { type Abi = ::core::mem::ManuallyDrop<Self>; } pub const OLEUI_BZERR_HTASKINVALID: u32 = 116u32; pub const OLEUI_BZ_CALLUNBLOCKED: u32 = 119u32; pub const OLEUI_BZ_RETRYSELECTED: u32 = 118u32; pub const OLEUI_BZ_SWITCHTOSELECTED: u32 = 117u32; pub const OLEUI_CANCEL: u32 = 2u32; pub const OLEUI_CIERR_MUSTHAVECLSID: u32 = 116u32; pub const OLEUI_CIERR_MUSTHAVECURRENTMETAFILE: u32 = 117u32; pub const OLEUI_CIERR_SZICONEXEINVALID: u32 = 118u32; pub const OLEUI_CSERR_FROMNOTNULL: u32 = 118u32; pub const OLEUI_CSERR_LINKCNTRINVALID: u32 = 117u32; pub const OLEUI_CSERR_LINKCNTRNULL: u32 = 116u32; pub const OLEUI_CSERR_SOURCEINVALID: u32 = 121u32; pub const OLEUI_CSERR_SOURCENULL: u32 = 120u32; pub const OLEUI_CSERR_SOURCEPARSEERROR: u32 = 122u32; pub const OLEUI_CSERR_SOURCEPARSERROR: u32 = 122u32; pub const OLEUI_CSERR_TONOTNULL: u32 = 119u32; pub const OLEUI_CTERR_CBFORMATINVALID: u32 = 119u32; pub const OLEUI_CTERR_CLASSIDINVALID: u32 = 117u32; pub const OLEUI_CTERR_DVASPECTINVALID: u32 = 118u32; pub const OLEUI_CTERR_HMETAPICTINVALID: u32 = 120u32; pub const OLEUI_CTERR_STRINGINVALID: u32 = 121u32; pub const OLEUI_ELERR_LINKCNTRINVALID: u32 = 117u32; pub const OLEUI_ELERR_LINKCNTRNULL: u32 = 116u32; pub const OLEUI_ERR_CBSTRUCTINCORRECT: u32 = 103u32; pub const OLEUI_ERR_DIALOGFAILURE: u32 = 112u32; pub const OLEUI_ERR_FINDTEMPLATEFAILURE: u32 = 110u32; pub const OLEUI_ERR_GLOBALMEMALLOC: u32 = 114u32; pub const OLEUI_ERR_HINSTANCEINVALID: u32 = 107u32; pub const OLEUI_ERR_HRESOURCEINVALID: u32 = 109u32; pub const OLEUI_ERR_HWNDOWNERINVALID: u32 = 104u32; pub const OLEUI_ERR_LOADSTRING: u32 = 115u32; pub const OLEUI_ERR_LOADTEMPLATEFAILURE: u32 = 111u32; pub const OLEUI_ERR_LOCALMEMALLOC: u32 = 113u32; pub const OLEUI_ERR_LPFNHOOKINVALID: u32 = 106u32; pub const OLEUI_ERR_LPSZCAPTIONINVALID: u32 = 105u32; pub const OLEUI_ERR_LPSZTEMPLATEINVALID: u32 = 108u32; pub const OLEUI_ERR_OLEMEMALLOC: u32 = 100u32; pub const OLEUI_ERR_STANDARDMAX: u32 = 116u32; pub const OLEUI_ERR_STANDARDMIN: u32 = 100u32; pub const OLEUI_ERR_STRUCTUREINVALID: u32 = 102u32; pub const OLEUI_ERR_STRUCTURENULL: u32 = 101u32; pub const OLEUI_FALSE: u32 = 0u32; pub const OLEUI_GPERR_CBFORMATINVALID: u32 = 130u32; pub const OLEUI_GPERR_CLASSIDINVALID: u32 = 128u32; pub const OLEUI_GPERR_LPCLSIDEXCLUDEINVALID: u32 = 129u32; pub const OLEUI_GPERR_STRINGINVALID: u32 = 127u32; pub const OLEUI_IOERR_ARRLINKTYPESINVALID: u32 = 118u32; pub const OLEUI_IOERR_ARRPASTEENTRIESINVALID: u32 = 117u32; pub const OLEUI_IOERR_CCHFILEINVALID: u32 = 125u32; pub const OLEUI_IOERR_HICONINVALID: u32 = 118u32; pub const OLEUI_IOERR_LPCLSIDEXCLUDEINVALID: u32 = 124u32; pub const OLEUI_IOERR_LPFORMATETCINVALID: u32 = 119u32; pub const OLEUI_IOERR_LPIOLECLIENTSITEINVALID: u32 = 121u32; pub const OLEUI_IOERR_LPISTORAGEINVALID: u32 = 122u32; pub const OLEUI_IOERR_LPSZFILEINVALID: u32 = 116u32; pub const OLEUI_IOERR_LPSZLABELINVALID: u32 = 117u32; pub const OLEUI_IOERR_PPVOBJINVALID: u32 = 120u32; pub const OLEUI_IOERR_SCODEHASERROR: u32 = 123u32; pub const OLEUI_IOERR_SRCDATAOBJECTINVALID: u32 = 116u32; pub const OLEUI_LPERR_LINKCNTRINVALID: u32 = 134u32; pub const OLEUI_LPERR_LINKCNTRNULL: u32 = 133u32; pub const OLEUI_OK: u32 = 1u32; pub const OLEUI_OPERR_DLGPROCNOTNULL: u32 = 125u32; pub const OLEUI_OPERR_INVALIDPAGES: u32 = 123u32; pub const OLEUI_OPERR_LINKINFOINVALID: u32 = 137u32; pub const OLEUI_OPERR_LPARAMNOTZERO: u32 = 126u32; pub const OLEUI_OPERR_NOTSUPPORTED: u32 = 124u32; pub const OLEUI_OPERR_OBJINFOINVALID: u32 = 136u32; pub const OLEUI_OPERR_PAGESINCORRECT: u32 = 122u32; pub const OLEUI_OPERR_PROPERTYSHEET: u32 = 135u32; pub const OLEUI_OPERR_PROPSHEETINVALID: u32 = 119u32; pub const OLEUI_OPERR_PROPSHEETNULL: u32 = 118u32; pub const OLEUI_OPERR_PROPSINVALID: u32 = 121u32; pub const OLEUI_OPERR_SUBPROPINVALID: u32 = 117u32; pub const OLEUI_OPERR_SUBPROPNULL: u32 = 116u32; pub const OLEUI_OPERR_SUPPROP: u32 = 120u32; pub const OLEUI_PSERR_CLIPBOARDCHANGED: u32 = 119u32; pub const OLEUI_PSERR_GETCLIPBOARDFAILED: u32 = 120u32; pub const OLEUI_QUERY_GETCLASSID: u32 = 65280u32; pub const OLEUI_QUERY_LINKBROKEN: u32 = 65281u32; pub const OLEUI_SUCCESS: u32 = 1u32; pub const OLEUI_VPERR_DVASPECTINVALID: u32 = 132u32; pub const OLEUI_VPERR_METAPICTINVALID: u32 = 131u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLEUPDATE(pub i32); pub const OLEUPDATE_ALWAYS: OLEUPDATE = OLEUPDATE(1i32); pub const OLEUPDATE_ONCALL: OLEUPDATE = OLEUPDATE(3i32); impl ::core::convert::From<i32> for OLEUPDATE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLEUPDATE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct OLEVERB { pub lVerb: i32, pub lpszVerbName: super::super::Foundation::PWSTR, pub fuFlags: u32, pub grfAttribs: u32, } #[cfg(feature = "Win32_Foundation")] impl OLEVERB {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for OLEVERB { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for OLEVERB { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OLEVERB").field("lVerb", &self.lVerb).field("lpszVerbName", &self.lpszVerbName).field("fuFlags", &self.fuFlags).field("grfAttribs", &self.grfAttribs).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for OLEVERB { fn eq(&self, other: &Self) -> bool { self.lVerb == other.lVerb && self.lpszVerbName == other.lpszVerbName && self.fuFlags == other.fuFlags && self.grfAttribs == other.grfAttribs } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for OLEVERB {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for OLEVERB { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLEVERBATTRIB(pub i32); pub const OLEVERBATTRIB_NEVERDIRTIES: OLEVERBATTRIB = OLEVERBATTRIB(1i32); pub const OLEVERBATTRIB_ONCONTAINERMENU: OLEVERBATTRIB = OLEVERBATTRIB(2i32); impl ::core::convert::From<i32> for OLEVERBATTRIB { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLEVERBATTRIB { type Abi = Self; } pub const OLEVERB_PRIMARY: u32 = 0u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLEWHICHMK(pub i32); pub const OLEWHICHMK_CONTAINER: OLEWHICHMK = OLEWHICHMK(1i32); pub const OLEWHICHMK_OBJREL: OLEWHICHMK = OLEWHICHMK(2i32); pub const OLEWHICHMK_OBJFULL: OLEWHICHMK = OLEWHICHMK(3i32); impl ::core::convert::From<i32> for OLEWHICHMK { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLEWHICHMK { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OLE_TRISTATE(pub i32); pub const triUnchecked: OLE_TRISTATE = OLE_TRISTATE(0i32); pub const triChecked: OLE_TRISTATE = OLE_TRISTATE(1i32); pub const triGray: OLE_TRISTATE = OLE_TRISTATE(2i32); impl ::core::convert::From<i32> for OLE_TRISTATE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OLE_TRISTATE { type Abi = Self; } pub const OPF_DISABLECONVERT: i32 = 8i32; pub const OPF_NOFILLDEFAULT: i32 = 2i32; pub const OPF_OBJECTISLINK: i32 = 1i32; pub const OPF_SHOWHELP: i32 = 4i32; pub const OT_EMBEDDED: i32 = 2i32; pub const OT_LINK: i32 = 1i32; pub const OT_STATIC: i32 = 3i32; #[inline] pub unsafe fn OaBuildVersion() -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OaBuildVersion() -> u32; } ::core::mem::transmute(OaBuildVersion()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OaEnablePerUserTLibRegistration() { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OaEnablePerUserTLibRegistration(); } ::core::mem::transmute(OaEnablePerUserTLibRegistration()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleBuildVersion() -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleBuildVersion() -> u32; } ::core::mem::transmute(OleBuildVersion()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreate<'a, Param4: ::windows::core::IntoParam<'a, IOleClientSite>, Param5: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>(rclsid: *const ::windows::core::GUID, riid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: Param4, pstg: Param5, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreate(rclsid: *const ::windows::core::GUID, riid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreate(::core::mem::transmute(rclsid), ::core::mem::transmute(riid), ::core::mem::transmute(renderopt), ::core::mem::transmute(pformatetc), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleCreateDefaultHandler<'a, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(clsid: *const ::windows::core::GUID, punkouter: Param1, riid: *const ::windows::core::GUID, lplpobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateDefaultHandler(clsid: *const ::windows::core::GUID, punkouter: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, lplpobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateDefaultHandler(::core::mem::transmute(clsid), punkouter.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(lplpobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleCreateEmbeddingHelper<'a, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param3: ::windows::core::IntoParam<'a, super::Com::IClassFactory>>(clsid: *const ::windows::core::GUID, punkouter: Param1, flags: u32, pcf: Param3, riid: *const ::windows::core::GUID, lplpobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateEmbeddingHelper(clsid: *const ::windows::core::GUID, punkouter: ::windows::core::RawPtr, flags: u32, pcf: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, lplpobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateEmbeddingHelper(::core::mem::transmute(clsid), punkouter.into_param().abi(), ::core::mem::transmute(flags), pcf.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(lplpobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateEx<'a, Param7: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>, Param9: ::windows::core::IntoParam<'a, IOleClientSite>, Param10: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>( rclsid: *const ::windows::core::GUID, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: Param7, rgdwconnection: *mut u32, pclientsite: Param9, pstg: Param10, ppvobj: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateEx(rclsid: *const ::windows::core::GUID, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: ::windows::core::RawPtr, rgdwconnection: *mut u32, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateEx( ::core::mem::transmute(rclsid), ::core::mem::transmute(riid), ::core::mem::transmute(dwflags), ::core::mem::transmute(renderopt), ::core::mem::transmute(cformats), ::core::mem::transmute(rgadvf), ::core::mem::transmute(rgformatetc), lpadvisesink.into_param().abi(), ::core::mem::transmute(rgdwconnection), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj), ) .ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleCreateFontIndirect(lpfontdesc: *mut FONTDESC, riid: *const ::windows::core::GUID, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateFontIndirect(lpfontdesc: *mut FONTDESC, riid: *const ::windows::core::GUID, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateFontIndirect(::core::mem::transmute(lpfontdesc), ::core::mem::transmute(riid), ::core::mem::transmute(lplpvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateFromData<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param4: ::windows::core::IntoParam<'a, IOleClientSite>, Param5: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>(psrcdataobj: Param0, riid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: Param4, pstg: Param5, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateFromData(psrcdataobj: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateFromData(psrcdataobj.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(renderopt), ::core::mem::transmute(pformatetc), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateFromDataEx<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param7: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>, Param9: ::windows::core::IntoParam<'a, IOleClientSite>, Param10: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>( psrcdataobj: Param0, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: Param7, rgdwconnection: *mut u32, pclientsite: Param9, pstg: Param10, ppvobj: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateFromDataEx(psrcdataobj: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: ::windows::core::RawPtr, rgdwconnection: *mut u32, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateFromDataEx( psrcdataobj.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(dwflags), ::core::mem::transmute(renderopt), ::core::mem::transmute(cformats), ::core::mem::transmute(rgadvf), ::core::mem::transmute(rgformatetc), lpadvisesink.into_param().abi(), ::core::mem::transmute(rgdwconnection), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj), ) .ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateFromFile<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param5: ::windows::core::IntoParam<'a, IOleClientSite>, Param6: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>( rclsid: *const ::windows::core::GUID, lpszfilename: Param1, riid: *const ::windows::core::GUID, renderopt: u32, lpformatetc: *mut super::Com::FORMATETC, pclientsite: Param5, pstg: Param6, ppvobj: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateFromFile(rclsid: *const ::windows::core::GUID, lpszfilename: super::super::Foundation::PWSTR, riid: *const ::windows::core::GUID, renderopt: u32, lpformatetc: *mut super::Com::FORMATETC, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateFromFile(::core::mem::transmute(rclsid), lpszfilename.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(renderopt), ::core::mem::transmute(lpformatetc), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateFromFileEx<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param8: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>, Param10: ::windows::core::IntoParam<'a, IOleClientSite>, Param11: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>( rclsid: *const ::windows::core::GUID, lpszfilename: Param1, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: Param8, rgdwconnection: *mut u32, pclientsite: Param10, pstg: Param11, ppvobj: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateFromFileEx(rclsid: *const ::windows::core::GUID, lpszfilename: super::super::Foundation::PWSTR, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: ::windows::core::RawPtr, rgdwconnection: *mut u32, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateFromFileEx( ::core::mem::transmute(rclsid), lpszfilename.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(dwflags), ::core::mem::transmute(renderopt), ::core::mem::transmute(cformats), ::core::mem::transmute(rgadvf), ::core::mem::transmute(rgformatetc), lpadvisesink.into_param().abi(), ::core::mem::transmute(rgdwconnection), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj), ) .ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateLink<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IMoniker>, Param4: ::windows::core::IntoParam<'a, IOleClientSite>, Param5: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>(pmklinksrc: Param0, riid: *const ::windows::core::GUID, renderopt: u32, lpformatetc: *mut super::Com::FORMATETC, pclientsite: Param4, pstg: Param5, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateLink(pmklinksrc: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, renderopt: u32, lpformatetc: *mut super::Com::FORMATETC, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateLink(pmklinksrc.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(renderopt), ::core::mem::transmute(lpformatetc), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateLinkEx<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IMoniker>, Param7: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>, Param9: ::windows::core::IntoParam<'a, IOleClientSite>, Param10: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>( pmklinksrc: Param0, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: Param7, rgdwconnection: *mut u32, pclientsite: Param9, pstg: Param10, ppvobj: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateLinkEx(pmklinksrc: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: ::windows::core::RawPtr, rgdwconnection: *mut u32, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateLinkEx( pmklinksrc.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(dwflags), ::core::mem::transmute(renderopt), ::core::mem::transmute(cformats), ::core::mem::transmute(rgadvf), ::core::mem::transmute(rgformatetc), lpadvisesink.into_param().abi(), ::core::mem::transmute(rgdwconnection), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj), ) .ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateLinkFromData<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param4: ::windows::core::IntoParam<'a, IOleClientSite>, Param5: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>(psrcdataobj: Param0, riid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: Param4, pstg: Param5, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateLinkFromData(psrcdataobj: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateLinkFromData(psrcdataobj.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(renderopt), ::core::mem::transmute(pformatetc), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateLinkFromDataEx<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param7: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>, Param9: ::windows::core::IntoParam<'a, IOleClientSite>, Param10: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>( psrcdataobj: Param0, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: Param7, rgdwconnection: *mut u32, pclientsite: Param9, pstg: Param10, ppvobj: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateLinkFromDataEx(psrcdataobj: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: ::windows::core::RawPtr, rgdwconnection: *mut u32, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateLinkFromDataEx( psrcdataobj.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(dwflags), ::core::mem::transmute(renderopt), ::core::mem::transmute(cformats), ::core::mem::transmute(rgadvf), ::core::mem::transmute(rgformatetc), lpadvisesink.into_param().abi(), ::core::mem::transmute(rgdwconnection), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj), ) .ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateLinkToFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param4: ::windows::core::IntoParam<'a, IOleClientSite>, Param5: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>(lpszfilename: Param0, riid: *const ::windows::core::GUID, renderopt: u32, lpformatetc: *mut super::Com::FORMATETC, pclientsite: Param4, pstg: Param5, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateLinkToFile(lpszfilename: super::super::Foundation::PWSTR, riid: *const ::windows::core::GUID, renderopt: u32, lpformatetc: *mut super::Com::FORMATETC, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateLinkToFile(lpszfilename.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(renderopt), ::core::mem::transmute(lpformatetc), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateLinkToFileEx<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, super::Com::IAdviseSink>, Param9: ::windows::core::IntoParam<'a, IOleClientSite>, Param10: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>( lpszfilename: Param0, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: Param7, rgdwconnection: *mut u32, pclientsite: Param9, pstg: Param10, ppvobj: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateLinkToFileEx(lpszfilename: super::super::Foundation::PWSTR, riid: *const ::windows::core::GUID, dwflags: u32, renderopt: u32, cformats: u32, rgadvf: *mut u32, rgformatetc: *mut super::Com::FORMATETC, lpadvisesink: ::windows::core::RawPtr, rgdwconnection: *mut u32, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateLinkToFileEx( lpszfilename.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(dwflags), ::core::mem::transmute(renderopt), ::core::mem::transmute(cformats), ::core::mem::transmute(rgadvf), ::core::mem::transmute(rgformatetc), lpadvisesink.into_param().abi(), ::core::mem::transmute(rgdwconnection), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj), ) .ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] #[inline] pub unsafe fn OleCreateMenuDescriptor<'a, Param0: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HMENU>>(hmenucombined: Param0, lpmenuwidths: *mut OleMenuGroupWidths) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateMenuDescriptor(hmenucombined: super::super::UI::WindowsAndMessaging::HMENU, lpmenuwidths: *mut OleMenuGroupWidths) -> isize; } ::core::mem::transmute(OleCreateMenuDescriptor(hmenucombined.into_param().abi(), ::core::mem::transmute(lpmenuwidths))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleCreatePictureIndirect<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(lppictdesc: *mut PICTDESC, riid: *const ::windows::core::GUID, fown: Param2, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreatePictureIndirect(lppictdesc: *mut PICTDESC, riid: *const ::windows::core::GUID, fown: super::super::Foundation::BOOL, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreatePictureIndirect(::core::mem::transmute(lppictdesc), ::core::mem::transmute(riid), fown.into_param().abi(), ::core::mem::transmute(lplpvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleCreatePropertyFrame<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hwndowner: Param0, x: u32, y: u32, lpszcaption: Param3, cobjects: u32, ppunk: *mut ::core::option::Option<::windows::core::IUnknown>, cpages: u32, ppageclsid: *mut ::windows::core::GUID, lcid: u32, dwreserved: u32, pvreserved: *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreatePropertyFrame(hwndowner: super::super::Foundation::HWND, x: u32, y: u32, lpszcaption: super::super::Foundation::PWSTR, cobjects: u32, ppunk: *mut ::windows::core::RawPtr, cpages: u32, ppageclsid: *mut ::windows::core::GUID, lcid: u32, dwreserved: u32, pvreserved: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreatePropertyFrame( hwndowner.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y), lpszcaption.into_param().abi(), ::core::mem::transmute(cobjects), ::core::mem::transmute(ppunk), ::core::mem::transmute(cpages), ::core::mem::transmute(ppageclsid), ::core::mem::transmute(lcid), ::core::mem::transmute(dwreserved), ::core::mem::transmute(pvreserved), ) .ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleCreatePropertyFrameIndirect(lpparams: *mut OCPFIPARAMS) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreatePropertyFrameIndirect(lpparams: *mut OCPFIPARAMS) -> ::windows::core::HRESULT; } OleCreatePropertyFrameIndirect(::core::mem::transmute(lpparams)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleCreateStaticFromData<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>, Param4: ::windows::core::IntoParam<'a, IOleClientSite>, Param5: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>(psrcdataobj: Param0, iid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: Param4, pstg: Param5, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleCreateStaticFromData(psrcdataobj: ::windows::core::RawPtr, iid: *const ::windows::core::GUID, renderopt: u32, pformatetc: *mut super::Com::FORMATETC, pclientsite: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleCreateStaticFromData(psrcdataobj.into_param().abi(), ::core::mem::transmute(iid), ::core::mem::transmute(renderopt), ::core::mem::transmute(pformatetc), pclientsite.into_param().abi(), pstg.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleDestroyMenuDescriptor(holemenu: isize) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleDestroyMenuDescriptor(holemenu: isize) -> ::windows::core::HRESULT; } OleDestroyMenuDescriptor(::core::mem::transmute(holemenu)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com_StructuredStorage")] #[inline] pub unsafe fn OleDoAutoConvert<'a, Param0: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>>(pstg: Param0, pclsidnew: *mut ::windows::core::GUID) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleDoAutoConvert(pstg: ::windows::core::RawPtr, pclsidnew: *mut ::windows::core::GUID) -> ::windows::core::HRESULT; } OleDoAutoConvert(pstg.into_param().abi(), ::core::mem::transmute(pclsidnew)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn OleDraw<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(punknown: Param0, dwaspect: u32, hdcdraw: Param2, lprcbounds: *mut super::super::Foundation::RECT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleDraw(punknown: ::windows::core::RawPtr, dwaspect: u32, hdcdraw: super::super::Graphics::Gdi::HDC, lprcbounds: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT; } OleDraw(punknown.into_param().abi(), ::core::mem::transmute(dwaspect), hdcdraw.into_param().abi(), ::core::mem::transmute(lprcbounds)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleDuplicateData<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HANDLE>>(hsrc: Param0, cfformat: u16, uiflags: u32) -> super::super::Foundation::HANDLE { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleDuplicateData(hsrc: super::super::Foundation::HANDLE, cfformat: u16, uiflags: u32) -> super::super::Foundation::HANDLE; } ::core::mem::transmute(OleDuplicateData(hsrc.into_param().abi(), ::core::mem::transmute(cfformat), ::core::mem::transmute(uiflags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleFlushClipboard() -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleFlushClipboard() -> ::windows::core::HRESULT; } OleFlushClipboard().ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleGetAutoConvert(clsidold: *const ::windows::core::GUID, pclsidnew: *mut ::windows::core::GUID) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleGetAutoConvert(clsidold: *const ::windows::core::GUID, pclsidnew: *mut ::windows::core::GUID) -> ::windows::core::HRESULT; } OleGetAutoConvert(::core::mem::transmute(clsidold), ::core::mem::transmute(pclsidnew)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleGetClipboard() -> ::windows::core::Result<super::Com::IDataObject> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleGetClipboard(ppdataobj: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <super::Com::IDataObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); OleGetClipboard(&mut result__).from_abi::<super::Com::IDataObject>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleGetClipboardWithEnterpriseInfo(dataobject: *mut ::core::option::Option<super::Com::IDataObject>, dataenterpriseid: *mut super::super::Foundation::PWSTR, sourcedescription: *mut super::super::Foundation::PWSTR, targetdescription: *mut super::super::Foundation::PWSTR, datadescription: *mut super::super::Foundation::PWSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleGetClipboardWithEnterpriseInfo(dataobject: *mut ::windows::core::RawPtr, dataenterpriseid: *mut super::super::Foundation::PWSTR, sourcedescription: *mut super::super::Foundation::PWSTR, targetdescription: *mut super::super::Foundation::PWSTR, datadescription: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT; } OleGetClipboardWithEnterpriseInfo(::core::mem::transmute(dataobject), ::core::mem::transmute(dataenterpriseid), ::core::mem::transmute(sourcedescription), ::core::mem::transmute(targetdescription), ::core::mem::transmute(datadescription)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleGetIconOfClass<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(rclsid: *const ::windows::core::GUID, lpszlabel: Param1, fusetypeaslabel: Param2) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleGetIconOfClass(rclsid: *const ::windows::core::GUID, lpszlabel: super::super::Foundation::PWSTR, fusetypeaslabel: super::super::Foundation::BOOL) -> isize; } ::core::mem::transmute(OleGetIconOfClass(::core::mem::transmute(rclsid), lpszlabel.into_param().abi(), fusetypeaslabel.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleGetIconOfFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(lpszpath: Param0, fusefileaslabel: Param1) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleGetIconOfFile(lpszpath: super::super::Foundation::PWSTR, fusefileaslabel: super::super::Foundation::BOOL) -> isize; } ::core::mem::transmute(OleGetIconOfFile(lpszpath.into_param().abi(), fusefileaslabel.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleIconToCursor<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param1: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HICON>>(hinstexe: Param0, hicon: Param1) -> super::super::UI::WindowsAndMessaging::HCURSOR { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleIconToCursor(hinstexe: super::super::Foundation::HINSTANCE, hicon: super::super::UI::WindowsAndMessaging::HICON) -> super::super::UI::WindowsAndMessaging::HCURSOR; } ::core::mem::transmute(OleIconToCursor(hinstexe.into_param().abi(), hicon.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleInitialize(pvreserved: *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleInitialize(pvreserved: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleInitialize(::core::mem::transmute(pvreserved)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleIsCurrentClipboard<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(pdataobj: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleIsCurrentClipboard(pdataobj: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } OleIsCurrentClipboard(pdataobj.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleIsRunning<'a, Param0: ::windows::core::IntoParam<'a, IOleObject>>(pobject: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleIsRunning(pobject: ::windows::core::RawPtr) -> super::super::Foundation::BOOL; } ::core::mem::transmute(OleIsRunning(pobject.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com_StructuredStorage")] #[inline] pub unsafe fn OleLoad<'a, Param0: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>, Param2: ::windows::core::IntoParam<'a, IOleClientSite>>(pstg: Param0, riid: *const ::windows::core::GUID, pclientsite: Param2, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLoad(pstg: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, pclientsite: ::windows::core::RawPtr, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleLoad(pstg.into_param().abi(), ::core::mem::transmute(riid), pclientsite.into_param().abi(), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleLoadFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IStream>>(pstm: Param0, iidinterface: *const ::windows::core::GUID, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLoadFromStream(pstm: ::windows::core::RawPtr, iidinterface: *const ::windows::core::GUID, ppvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleLoadFromStream(pstm.into_param().abi(), ::core::mem::transmute(iidinterface), ::core::mem::transmute(ppvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleLoadPicture<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(lpstream: Param0, lsize: i32, frunmode: Param2, riid: *const ::windows::core::GUID, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLoadPicture(lpstream: ::windows::core::RawPtr, lsize: i32, frunmode: super::super::Foundation::BOOL, riid: *const ::windows::core::GUID, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleLoadPicture(lpstream.into_param().abi(), ::core::mem::transmute(lsize), frunmode.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(lplpvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleLoadPictureEx<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(lpstream: Param0, lsize: i32, frunmode: Param2, riid: *const ::windows::core::GUID, xsizedesired: u32, ysizedesired: u32, dwflags: u32, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLoadPictureEx(lpstream: ::windows::core::RawPtr, lsize: i32, frunmode: super::super::Foundation::BOOL, riid: *const ::windows::core::GUID, xsizedesired: u32, ysizedesired: u32, dwflags: u32, lplpvobj: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleLoadPictureEx(lpstream.into_param().abi(), ::core::mem::transmute(lsize), frunmode.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(xsizedesired), ::core::mem::transmute(ysizedesired), ::core::mem::transmute(dwflags), ::core::mem::transmute(lplpvobj)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleLoadPictureFile<'a, Param0: ::windows::core::IntoParam<'a, super::Com::VARIANT>>(varfilename: Param0) -> ::windows::core::Result<super::Com::IDispatch> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLoadPictureFile(varfilename: ::core::mem::ManuallyDrop<super::Com::VARIANT>, lplpdisppicture: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <super::Com::IDispatch as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); OleLoadPictureFile(varfilename.into_param().abi(), &mut result__).from_abi::<super::Com::IDispatch>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleLoadPictureFileEx<'a, Param0: ::windows::core::IntoParam<'a, super::Com::VARIANT>>(varfilename: Param0, xsizedesired: u32, ysizedesired: u32, dwflags: u32) -> ::windows::core::Result<super::Com::IDispatch> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLoadPictureFileEx(varfilename: ::core::mem::ManuallyDrop<super::Com::VARIANT>, xsizedesired: u32, ysizedesired: u32, dwflags: u32, lplpdisppicture: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <super::Com::IDispatch as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); OleLoadPictureFileEx(varfilename.into_param().abi(), ::core::mem::transmute(xsizedesired), ::core::mem::transmute(ysizedesired), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::Com::IDispatch>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleLoadPicturePath<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(szurlorpath: Param0, punkcaller: Param1, dwreserved: u32, clrreserved: u32, riid: *const ::windows::core::GUID, ppvret: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLoadPicturePath(szurlorpath: super::super::Foundation::PWSTR, punkcaller: ::windows::core::RawPtr, dwreserved: u32, clrreserved: u32, riid: *const ::windows::core::GUID, ppvret: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } OleLoadPicturePath(szurlorpath.into_param().abi(), punkcaller.into_param().abi(), ::core::mem::transmute(dwreserved), ::core::mem::transmute(clrreserved), ::core::mem::transmute(riid), ::core::mem::transmute(ppvret)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleLockRunning<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(punknown: Param0, flock: Param1, flastunlockcloses: Param2) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleLockRunning(punknown: ::windows::core::RawPtr, flock: super::super::Foundation::BOOL, flastunlockcloses: super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } OleLockRunning(punknown.into_param().abi(), flock.into_param().abi(), flastunlockcloses.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct OleMenuGroupWidths { pub width: [i32; 6], } impl OleMenuGroupWidths {} impl ::core::default::Default for OleMenuGroupWidths { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for OleMenuGroupWidths { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("OleMenuGroupWidths").field("width", &self.width).finish() } } impl ::core::cmp::PartialEq for OleMenuGroupWidths { fn eq(&self, other: &Self) -> bool { self.width == other.width } } impl ::core::cmp::Eq for OleMenuGroupWidths {} unsafe impl ::windows::core::Abi for OleMenuGroupWidths { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleMetafilePictFromIconAndLabel<'a, Param0: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HICON>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hicon: Param0, lpszlabel: Param1, lpszsourcefile: Param2, iiconindex: u32) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleMetafilePictFromIconAndLabel(hicon: super::super::UI::WindowsAndMessaging::HICON, lpszlabel: super::super::Foundation::PWSTR, lpszsourcefile: super::super::Foundation::PWSTR, iiconindex: u32) -> isize; } ::core::mem::transmute(OleMetafilePictFromIconAndLabel(hicon.into_param().abi(), lpszlabel.into_param().abi(), lpszsourcefile.into_param().abi(), ::core::mem::transmute(iiconindex))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleNoteObjectVisible<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(punknown: Param0, fvisible: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleNoteObjectVisible(punknown: ::windows::core::RawPtr, fvisible: super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } OleNoteObjectVisible(punknown.into_param().abi(), fvisible.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleQueryCreateFromData<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(psrcdataobject: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleQueryCreateFromData(psrcdataobject: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } OleQueryCreateFromData(psrcdataobject.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleQueryLinkFromData<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(psrcdataobject: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleQueryLinkFromData(psrcdataobject: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } OleQueryLinkFromData(psrcdataobject.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleRegEnumFormatEtc(clsid: *const ::windows::core::GUID, dwdirection: u32) -> ::windows::core::Result<super::Com::IEnumFORMATETC> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleRegEnumFormatEtc(clsid: *const ::windows::core::GUID, dwdirection: u32, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <super::Com::IEnumFORMATETC as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); OleRegEnumFormatEtc(::core::mem::transmute(clsid), ::core::mem::transmute(dwdirection), &mut result__).from_abi::<super::Com::IEnumFORMATETC>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleRegEnumVerbs(clsid: *const ::windows::core::GUID) -> ::windows::core::Result<IEnumOLEVERB> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleRegEnumVerbs(clsid: *const ::windows::core::GUID, ppenum: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <IEnumOLEVERB as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); OleRegEnumVerbs(::core::mem::transmute(clsid), &mut result__).from_abi::<IEnumOLEVERB>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleRegGetMiscStatus(clsid: *const ::windows::core::GUID, dwaspect: u32, pdwstatus: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleRegGetMiscStatus(clsid: *const ::windows::core::GUID, dwaspect: u32, pdwstatus: *mut u32) -> ::windows::core::HRESULT; } OleRegGetMiscStatus(::core::mem::transmute(clsid), ::core::mem::transmute(dwaspect), ::core::mem::transmute(pdwstatus)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleRegGetUserType(clsid: *const ::windows::core::GUID, dwformoftype: u32) -> ::windows::core::Result<super::super::Foundation::PWSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleRegGetUserType(clsid: *const ::windows::core::GUID, dwformoftype: u32, pszusertype: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); OleRegGetUserType(::core::mem::transmute(clsid), ::core::mem::transmute(dwformoftype), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleRun<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(punknown: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleRun(punknown: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } OleRun(punknown.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleSave<'a, Param0: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IPersistStorage>, Param1: ::windows::core::IntoParam<'a, super::Com::StructuredStorage::IStorage>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(pps: Param0, pstg: Param1, fsameasload: Param2) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleSave(pps: ::windows::core::RawPtr, pstg: ::windows::core::RawPtr, fsameasload: super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } OleSave(pps.into_param().abi(), pstg.into_param().abi(), fsameasload.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleSavePictureFile<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(lpdisppicture: Param0, bstrfilename: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleSavePictureFile(lpdisppicture: ::windows::core::RawPtr, bstrfilename: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } OleSavePictureFile(lpdisppicture.into_param().abi(), bstrfilename.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleSaveToStream<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IPersistStream>, Param1: ::windows::core::IntoParam<'a, super::Com::IStream>>(ppstm: Param0, pstm: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleSaveToStream(ppstm: ::windows::core::RawPtr, pstm: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } OleSaveToStream(ppstm.into_param().abi(), pstm.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleSetAutoConvert(clsidold: *const ::windows::core::GUID, clsidnew: *const ::windows::core::GUID) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleSetAutoConvert(clsidold: *const ::windows::core::GUID, clsidnew: *const ::windows::core::GUID) -> ::windows::core::HRESULT; } OleSetAutoConvert(::core::mem::transmute(clsidold), ::core::mem::transmute(clsidnew)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn OleSetClipboard<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDataObject>>(pdataobj: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleSetClipboard(pdataobj: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } OleSetClipboard(pdataobj.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleSetContainedObject<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(punknown: Param0, fcontained: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleSetContainedObject(punknown: ::windows::core::RawPtr, fcontained: super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } OleSetContainedObject(punknown.into_param().abi(), fcontained.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleSetMenuDescriptor<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, IOleInPlaceFrame>, Param4: ::windows::core::IntoParam<'a, IOleInPlaceActiveObject>>(holemenu: isize, hwndframe: Param1, hwndactiveobject: Param2, lpframe: Param3, lpactiveobj: Param4) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleSetMenuDescriptor(holemenu: isize, hwndframe: super::super::Foundation::HWND, hwndactiveobject: super::super::Foundation::HWND, lpframe: ::windows::core::RawPtr, lpactiveobj: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } OleSetMenuDescriptor(::core::mem::transmute(holemenu), hwndframe.into_param().abi(), hwndactiveobject.into_param().abi(), lpframe.into_param().abi(), lpactiveobj.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleTranslateAccelerator<'a, Param0: ::windows::core::IntoParam<'a, IOleInPlaceFrame>>(lpframe: Param0, lpframeinfo: *mut OIFI, lpmsg: *mut super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleTranslateAccelerator(lpframe: ::windows::core::RawPtr, lpframeinfo: *mut OIFI, lpmsg: *mut super::super::UI::WindowsAndMessaging::MSG) -> ::windows::core::HRESULT; } OleTranslateAccelerator(lpframe.into_param().abi(), ::core::mem::transmute(lpframeinfo), ::core::mem::transmute(lpmsg)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn OleTranslateColor<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HPALETTE>>(clr: u32, hpal: Param1, lpcolorref: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleTranslateColor(clr: u32, hpal: super::super::Graphics::Gdi::HPALETTE, lpcolorref: *mut u32) -> ::windows::core::HRESULT; } OleTranslateColor(::core::mem::transmute(clr), hpal.into_param().abi(), ::core::mem::transmute(lpcolorref)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleUIAddVerbMenuA<'a, Param0: ::windows::core::IntoParam<'a, IOleObject>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>, Param2: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HMENU>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>( lpoleobj: Param0, lpszshorttype: Param1, hmenu: Param2, upos: u32, uidverbmin: u32, uidverbmax: u32, baddconvert: Param6, idconvert: u32, lphmenu: *mut super::super::UI::WindowsAndMessaging::HMENU, ) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIAddVerbMenuA(lpoleobj: ::windows::core::RawPtr, lpszshorttype: super::super::Foundation::PSTR, hmenu: super::super::UI::WindowsAndMessaging::HMENU, upos: u32, uidverbmin: u32, uidverbmax: u32, baddconvert: super::super::Foundation::BOOL, idconvert: u32, lphmenu: *mut super::super::UI::WindowsAndMessaging::HMENU) -> super::super::Foundation::BOOL; } ::core::mem::transmute(OleUIAddVerbMenuA( lpoleobj.into_param().abi(), lpszshorttype.into_param().abi(), hmenu.into_param().abi(), ::core::mem::transmute(upos), ::core::mem::transmute(uidverbmin), ::core::mem::transmute(uidverbmax), baddconvert.into_param().abi(), ::core::mem::transmute(idconvert), ::core::mem::transmute(lphmenu), )) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleUIAddVerbMenuW<'a, Param0: ::windows::core::IntoParam<'a, IOleObject>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::UI::WindowsAndMessaging::HMENU>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>( lpoleobj: Param0, lpszshorttype: Param1, hmenu: Param2, upos: u32, uidverbmin: u32, uidverbmax: u32, baddconvert: Param6, idconvert: u32, lphmenu: *mut super::super::UI::WindowsAndMessaging::HMENU, ) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIAddVerbMenuW(lpoleobj: ::windows::core::RawPtr, lpszshorttype: super::super::Foundation::PWSTR, hmenu: super::super::UI::WindowsAndMessaging::HMENU, upos: u32, uidverbmin: u32, uidverbmax: u32, baddconvert: super::super::Foundation::BOOL, idconvert: u32, lphmenu: *mut super::super::UI::WindowsAndMessaging::HMENU) -> super::super::Foundation::BOOL; } ::core::mem::transmute(OleUIAddVerbMenuW( lpoleobj.into_param().abi(), lpszshorttype.into_param().abi(), hmenu.into_param().abi(), ::core::mem::transmute(upos), ::core::mem::transmute(uidverbmin), ::core::mem::transmute(uidverbmax), baddconvert.into_param().abi(), ::core::mem::transmute(idconvert), ::core::mem::transmute(lphmenu), )) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] #[inline] pub unsafe fn OleUIBusyA(param0: *const OLEUIBUSYA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIBusyA(param0: *const ::core::mem::ManuallyDrop<OLEUIBUSYA>) -> u32; } ::core::mem::transmute(OleUIBusyA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Media"))] #[inline] pub unsafe fn OleUIBusyW(param0: *const OLEUIBUSYW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIBusyW(param0: *const ::core::mem::ManuallyDrop<OLEUIBUSYW>) -> u32; } ::core::mem::transmute(OleUIBusyW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUICanConvertOrActivateAs<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(rclsid: *const ::windows::core::GUID, fislinkedobject: Param1, wformat: u16) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUICanConvertOrActivateAs(rclsid: *const ::windows::core::GUID, fislinkedobject: super::super::Foundation::BOOL, wformat: u16) -> super::super::Foundation::BOOL; } ::core::mem::transmute(OleUICanConvertOrActivateAs(::core::mem::transmute(rclsid), fislinkedobject.into_param().abi(), ::core::mem::transmute(wformat))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIChangeIconA(param0: *const OLEUICHANGEICONA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIChangeIconA(param0: *const ::core::mem::ManuallyDrop<OLEUICHANGEICONA>) -> u32; } ::core::mem::transmute(OleUIChangeIconA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIChangeIconW(param0: *const OLEUICHANGEICONW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIChangeIconW(param0: *const ::core::mem::ManuallyDrop<OLEUICHANGEICONW>) -> u32; } ::core::mem::transmute(OleUIChangeIconW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] #[inline] pub unsafe fn OleUIChangeSourceA(param0: *const OLEUICHANGESOURCEA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIChangeSourceA(param0: *const ::core::mem::ManuallyDrop<OLEUICHANGESOURCEA>) -> u32; } ::core::mem::transmute(OleUIChangeSourceA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls_Dialogs"))] #[inline] pub unsafe fn OleUIChangeSourceW(param0: *const OLEUICHANGESOURCEW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIChangeSourceW(param0: *const ::core::mem::ManuallyDrop<OLEUICHANGESOURCEW>) -> u32; } ::core::mem::transmute(OleUIChangeSourceW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIConvertA(param0: *const OLEUICONVERTA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIConvertA(param0: *const ::core::mem::ManuallyDrop<OLEUICONVERTA>) -> u32; } ::core::mem::transmute(OleUIConvertA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIConvertW(param0: *const OLEUICONVERTW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIConvertW(param0: *const ::core::mem::ManuallyDrop<OLEUICONVERTW>) -> u32; } ::core::mem::transmute(OleUIConvertW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIEditLinksA(param0: *const OLEUIEDITLINKSA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIEditLinksA(param0: *const ::core::mem::ManuallyDrop<OLEUIEDITLINKSA>) -> u32; } ::core::mem::transmute(OleUIEditLinksA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIEditLinksW(param0: *const OLEUIEDITLINKSW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIEditLinksW(param0: *const ::core::mem::ManuallyDrop<OLEUIEDITLINKSW>) -> u32; } ::core::mem::transmute(OleUIEditLinksW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleUIInsertObjectA(param0: *const OLEUIINSERTOBJECTA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIInsertObjectA(param0: *const ::core::mem::ManuallyDrop<OLEUIINSERTOBJECTA>) -> u32; } ::core::mem::transmute(OleUIInsertObjectA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn OleUIInsertObjectW(param0: *const OLEUIINSERTOBJECTW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIInsertObjectW(param0: *const ::core::mem::ManuallyDrop<OLEUIINSERTOBJECTW>) -> u32; } ::core::mem::transmute(OleUIInsertObjectW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleUIObjectPropertiesA(param0: *const OLEUIOBJECTPROPSA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIObjectPropertiesA(param0: *const ::core::mem::ManuallyDrop<OLEUIOBJECTPROPSA>) -> u32; } ::core::mem::transmute(OleUIObjectPropertiesA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_Controls", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn OleUIObjectPropertiesW(param0: *const OLEUIOBJECTPROPSW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIObjectPropertiesW(param0: *const ::core::mem::ManuallyDrop<OLEUIOBJECTPROPSW>) -> u32; } ::core::mem::transmute(OleUIObjectPropertiesW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleUIPasteSpecialA(param0: *const OLEUIPASTESPECIALA) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIPasteSpecialA(param0: *const ::core::mem::ManuallyDrop<OLEUIPASTESPECIALA>) -> u32; } ::core::mem::transmute(OleUIPasteSpecialA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn OleUIPasteSpecialW(param0: *const OLEUIPASTESPECIALW) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIPasteSpecialW(param0: *const ::core::mem::ManuallyDrop<OLEUIPASTESPECIALW>) -> u32; } ::core::mem::transmute(OleUIPasteSpecialW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIPromptUserA<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(ntemplate: i32, hwndparent: Param1) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIPromptUserA(ntemplate: i32, hwndparent: super::super::Foundation::HWND) -> i32; } ::core::mem::transmute(OleUIPromptUserA(::core::mem::transmute(ntemplate), hwndparent.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIPromptUserW<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(ntemplate: i32, hwndparent: Param1) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIPromptUserW(ntemplate: i32, hwndparent: super::super::Foundation::HWND) -> i32; } ::core::mem::transmute(OleUIPromptUserW(::core::mem::transmute(ntemplate), hwndparent.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIUpdateLinksA<'a, Param0: ::windows::core::IntoParam<'a, IOleUILinkContainerA>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(lpoleuilinkcntr: Param0, hwndparent: Param1, lpsztitle: Param2, clinks: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIUpdateLinksA(lpoleuilinkcntr: ::windows::core::RawPtr, hwndparent: super::super::Foundation::HWND, lpsztitle: super::super::Foundation::PSTR, clinks: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(OleUIUpdateLinksA(lpoleuilinkcntr.into_param().abi(), hwndparent.into_param().abi(), lpsztitle.into_param().abi(), ::core::mem::transmute(clinks))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OleUIUpdateLinksW<'a, Param0: ::windows::core::IntoParam<'a, IOleUILinkContainerW>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(lpoleuilinkcntr: Param0, hwndparent: Param1, lpsztitle: Param2, clinks: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUIUpdateLinksW(lpoleuilinkcntr: ::windows::core::RawPtr, hwndparent: super::super::Foundation::HWND, lpsztitle: super::super::Foundation::PWSTR, clinks: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(OleUIUpdateLinksW(lpoleuilinkcntr.into_param().abi(), hwndparent.into_param().abi(), lpsztitle.into_param().abi(), ::core::mem::transmute(clinks))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn OleUninitialize() { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OleUninitialize(); } ::core::mem::transmute(OleUninitialize()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PAGEACTION_UI(pub i32); pub const PAGEACTION_UI_DEFAULT: PAGEACTION_UI = PAGEACTION_UI(0i32); pub const PAGEACTION_UI_MODAL: PAGEACTION_UI = PAGEACTION_UI(1i32); pub const PAGEACTION_UI_MODELESS: PAGEACTION_UI = PAGEACTION_UI(2i32); pub const PAGEACTION_UI_SILENT: PAGEACTION_UI = PAGEACTION_UI(3i32); impl ::core::convert::From<i32> for PAGEACTION_UI { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PAGEACTION_UI { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct PAGERANGE { pub nFromPage: i32, pub nToPage: i32, } impl PAGERANGE {} impl ::core::default::Default for PAGERANGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for PAGERANGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("PAGERANGE").field("nFromPage", &self.nFromPage).field("nToPage", &self.nToPage).finish() } } impl ::core::cmp::PartialEq for PAGERANGE { fn eq(&self, other: &Self) -> bool { self.nFromPage == other.nFromPage && self.nToPage == other.nToPage } } impl ::core::cmp::Eq for PAGERANGE {} unsafe impl ::windows::core::Abi for PAGERANGE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct PAGESET { pub cbStruct: u32, pub fOddPages: super::super::Foundation::BOOL, pub fEvenPages: super::super::Foundation::BOOL, pub cPageRange: u32, pub rgPages: [PAGERANGE; 1], } #[cfg(feature = "Win32_Foundation")] impl PAGESET {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for PAGESET { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for PAGESET { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("PAGESET").field("cbStruct", &self.cbStruct).field("fOddPages", &self.fOddPages).field("fEvenPages", &self.fEvenPages).field("cPageRange", &self.cPageRange).field("rgPages", &self.rgPages).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for PAGESET { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.fOddPages == other.fOddPages && self.fEvenPages == other.fEvenPages && self.cPageRange == other.cPageRange && self.rgPages == other.rgPages } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for PAGESET {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for PAGESET { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct PARAMDATA { pub szName: super::super::Foundation::PWSTR, pub vt: u16, } #[cfg(feature = "Win32_Foundation")] impl PARAMDATA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for PARAMDATA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for PARAMDATA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("PARAMDATA").field("szName", &self.szName).field("vt", &self.vt).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for PARAMDATA { fn eq(&self, other: &Self) -> bool { self.szName == other.szName && self.vt == other.vt } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for PARAMDATA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for PARAMDATA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct PARAMDESC { pub pparamdescex: *mut PARAMDESCEX, pub wParamFlags: u16, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl PARAMDESC {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for PARAMDESC { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for PARAMDESC { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("PARAMDESC").field("pparamdescex", &self.pparamdescex).field("wParamFlags", &self.wParamFlags).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for PARAMDESC { fn eq(&self, other: &Self) -> bool { self.pparamdescex == other.pparamdescex && self.wParamFlags == other.wParamFlags } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for PARAMDESC {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for PARAMDESC { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::clone::Clone for PARAMDESCEX { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct PARAMDESCEX { pub cBytes: u32, pub varDefaultValue: super::Com::VARIANT, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl PARAMDESCEX {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for PARAMDESCEX { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for PARAMDESCEX { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for PARAMDESCEX {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for PARAMDESCEX { type Abi = ::core::mem::ManuallyDrop<Self>; } pub const PARAMFLAG_FHASCUSTDATA: u32 = 64u32; pub const PARAMFLAG_FHASDEFAULT: u32 = 32u32; pub const PARAMFLAG_FIN: u32 = 1u32; pub const PARAMFLAG_FLCID: u32 = 4u32; pub const PARAMFLAG_FOPT: u32 = 16u32; pub const PARAMFLAG_FOUT: u32 = 2u32; pub const PARAMFLAG_FRETVAL: u32 = 8u32; pub const PARAMFLAG_NONE: u32 = 0u32; pub const PERPROP_E_FIRST: i32 = -2147220992i32; pub const PERPROP_E_LAST: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220977i32 as _); pub const PERPROP_E_NOPAGEAVAILABLE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220992i32 as _); pub const PERPROP_S_FIRST: ::windows::core::HRESULT = ::windows::core::HRESULT(262656i32 as _); pub const PERPROP_S_LAST: ::windows::core::HRESULT = ::windows::core::HRESULT(262671i32 as _); #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PICTDESC { pub cbSizeofstruct: u32, pub picType: u32, pub Anonymous: PICTDESC_0, } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PICTDESC {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PICTDESC { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PICTDESC { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PICTDESC {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PICTDESC { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PICTDESC_0 { pub bmp: PICTDESC_0_0, pub wmf: PICTDESC_0_3, pub icon: PICTDESC_0_2, pub emf: PICTDESC_0_1, } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PICTDESC_0 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PICTDESC_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PICTDESC_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PICTDESC_0 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PICTDESC_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PICTDESC_0_0 { pub hbitmap: super::super::Graphics::Gdi::HBITMAP, pub hpal: super::super::Graphics::Gdi::HPALETTE, } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PICTDESC_0_0 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PICTDESC_0_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for PICTDESC_0_0 { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_bmp_e__Struct").field("hbitmap", &self.hbitmap).field("hpal", &self.hpal).finish() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PICTDESC_0_0 { fn eq(&self, other: &Self) -> bool { self.hbitmap == other.hbitmap && self.hpal == other.hpal } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PICTDESC_0_0 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PICTDESC_0_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PICTDESC_0_1 { pub hemf: super::super::Graphics::Gdi::HENHMETAFILE, } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PICTDESC_0_1 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PICTDESC_0_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for PICTDESC_0_1 { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_emf_e__Struct").field("hemf", &self.hemf).finish() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PICTDESC_0_1 { fn eq(&self, other: &Self) -> bool { self.hemf == other.hemf } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PICTDESC_0_1 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PICTDESC_0_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PICTDESC_0_2 { pub hicon: super::super::UI::WindowsAndMessaging::HICON, } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PICTDESC_0_2 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PICTDESC_0_2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for PICTDESC_0_2 { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_icon_e__Struct").field("hicon", &self.hicon).finish() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PICTDESC_0_2 { fn eq(&self, other: &Self) -> bool { self.hicon == other.hicon } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PICTDESC_0_2 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PICTDESC_0_2 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PICTDESC_0_3 { pub hmeta: super::super::Graphics::Gdi::HMETAFILE, pub xExt: i32, pub yExt: i32, } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PICTDESC_0_3 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PICTDESC_0_3 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for PICTDESC_0_3 { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wmf_e__Struct").field("hmeta", &self.hmeta).field("xExt", &self.xExt).field("yExt", &self.yExt).finish() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PICTDESC_0_3 { fn eq(&self, other: &Self) -> bool { self.hmeta == other.hmeta && self.xExt == other.xExt && self.yExt == other.yExt } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PICTDESC_0_3 {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PICTDESC_0_3 { type Abi = Self; } pub const PICTYPE_BITMAP: u32 = 1u32; pub const PICTYPE_ENHMETAFILE: u32 = 4u32; pub const PICTYPE_ICON: u32 = 3u32; pub const PICTYPE_METAFILE: u32 = 2u32; pub const PICTYPE_NONE: u32 = 0u32; pub const PICTYPE_UNINITIALIZED: i32 = -1i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct POINTERINACTIVE(pub i32); pub const POINTERINACTIVE_ACTIVATEONENTRY: POINTERINACTIVE = POINTERINACTIVE(1i32); pub const POINTERINACTIVE_DEACTIVATEONLEAVE: POINTERINACTIVE = POINTERINACTIVE(2i32); pub const POINTERINACTIVE_ACTIVATEONDRAG: POINTERINACTIVE = POINTERINACTIVE(4i32); impl ::core::convert::From<i32> for POINTERINACTIVE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for POINTERINACTIVE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct POINTF { pub x: f32, pub y: f32, } impl POINTF {} impl ::core::default::Default for POINTF { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for POINTF { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("POINTF").field("x", &self.x).field("y", &self.y).finish() } } impl ::core::cmp::PartialEq for POINTF { fn eq(&self, other: &Self) -> bool { self.x == other.x && self.y == other.y } } impl ::core::cmp::Eq for POINTF {} unsafe impl ::windows::core::Abi for POINTF { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PRINTFLAG(pub u32); pub const PRINTFLAG_MAYBOTHERUSER: PRINTFLAG = PRINTFLAG(1u32); pub const PRINTFLAG_PROMPTUSER: PRINTFLAG = PRINTFLAG(2u32); pub const PRINTFLAG_USERMAYCHANGEPRINTER: PRINTFLAG = PRINTFLAG(4u32); pub const PRINTFLAG_RECOMPOSETODEVICE: PRINTFLAG = PRINTFLAG(8u32); pub const PRINTFLAG_DONTACTUALLYPRINT: PRINTFLAG = PRINTFLAG(16u32); pub const PRINTFLAG_FORCEPROPERTIES: PRINTFLAG = PRINTFLAG(32u32); pub const PRINTFLAG_PRINTTOFILE: PRINTFLAG = PRINTFLAG(64u32); impl ::core::convert::From<u32> for PRINTFLAG { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PRINTFLAG { type Abi = Self; } impl ::core::ops::BitOr for PRINTFLAG { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for PRINTFLAG { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for PRINTFLAG { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for PRINTFLAG { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for PRINTFLAG { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PROPBAG2_TYPE(pub i32); pub const PROPBAG2_TYPE_UNDEFINED: PROPBAG2_TYPE = PROPBAG2_TYPE(0i32); pub const PROPBAG2_TYPE_DATA: PROPBAG2_TYPE = PROPBAG2_TYPE(1i32); pub const PROPBAG2_TYPE_URL: PROPBAG2_TYPE = PROPBAG2_TYPE(2i32); pub const PROPBAG2_TYPE_OBJECT: PROPBAG2_TYPE = PROPBAG2_TYPE(3i32); pub const PROPBAG2_TYPE_STREAM: PROPBAG2_TYPE = PROPBAG2_TYPE(4i32); pub const PROPBAG2_TYPE_STORAGE: PROPBAG2_TYPE = PROPBAG2_TYPE(5i32); pub const PROPBAG2_TYPE_MONIKER: PROPBAG2_TYPE = PROPBAG2_TYPE(6i32); impl ::core::convert::From<i32> for PROPBAG2_TYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PROPBAG2_TYPE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct PROPPAGEINFO { pub cb: u32, pub pszTitle: super::super::Foundation::PWSTR, pub size: super::super::Foundation::SIZE, pub pszDocString: super::super::Foundation::PWSTR, pub pszHelpFile: super::super::Foundation::PWSTR, pub dwHelpContext: u32, } #[cfg(feature = "Win32_Foundation")] impl PROPPAGEINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for PROPPAGEINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for PROPPAGEINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("PROPPAGEINFO").field("cb", &self.cb).field("pszTitle", &self.pszTitle).field("size", &self.size).field("pszDocString", &self.pszDocString).field("pszHelpFile", &self.pszHelpFile).field("dwHelpContext", &self.dwHelpContext).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for PROPPAGEINFO { fn eq(&self, other: &Self) -> bool { self.cb == other.cb && self.pszTitle == other.pszTitle && self.size == other.size && self.pszDocString == other.pszDocString && self.pszHelpFile == other.pszHelpFile && self.dwHelpContext == other.dwHelpContext } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for PROPPAGEINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for PROPPAGEINFO { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PROPPAGESTATUS(pub i32); pub const PROPPAGESTATUS_DIRTY: PROPPAGESTATUS = PROPPAGESTATUS(1i32); pub const PROPPAGESTATUS_VALIDATE: PROPPAGESTATUS = PROPPAGESTATUS(2i32); pub const PROPPAGESTATUS_CLEAN: PROPPAGESTATUS = PROPPAGESTATUS(4i32); impl ::core::convert::From<i32> for PROPPAGESTATUS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PROPPAGESTATUS { type Abi = Self; } pub const PSF_CHECKDISPLAYASICON: i32 = 8i32; pub const PSF_DISABLEDISPLAYASICON: i32 = 16i32; pub const PSF_HIDECHANGEICON: i32 = 32i32; pub const PSF_NOREFRESHDATAOBJECT: i32 = 128i32; pub const PSF_SELECTPASTE: i32 = 2i32; pub const PSF_SELECTPASTELINK: i32 = 4i32; pub const PSF_SHOWHELP: i32 = 1i32; pub const PSF_STAYONCLIPBOARDCHANGE: i32 = 64i32; pub const PS_MAXLINKTYPES: u32 = 8u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PictureAttributes(pub i32); pub const PICTURE_SCALABLE: PictureAttributes = PictureAttributes(1i32); pub const PICTURE_TRANSPARENT: PictureAttributes = PictureAttributes(2i32); impl ::core::convert::From<i32> for PictureAttributes { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PictureAttributes { type Abi = Self; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] pub struct QACONTAINER { pub cbSize: u32, pub pClientSite: ::core::option::Option<IOleClientSite>, pub pAdviseSink: ::core::option::Option<IAdviseSinkEx>, pub pPropertyNotifySink: ::core::option::Option<IPropertyNotifySink>, pub pUnkEventSink: ::core::option::Option<::windows::core::IUnknown>, pub dwAmbientFlags: u32, pub colorFore: u32, pub colorBack: u32, pub pFont: ::core::option::Option<IFont>, pub pUndoMgr: ::core::option::Option<IOleUndoManager>, pub dwAppearance: u32, pub lcid: i32, pub hpal: super::super::Graphics::Gdi::HPALETTE, pub pBindHost: ::core::option::Option<super::Com::IBindHost>, pub pOleControlSite: ::core::option::Option<IOleControlSite>, pub pServiceProvider: ::core::option::Option<super::Com::IServiceProvider>, } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] impl QACONTAINER {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] impl ::core::default::Default for QACONTAINER { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for QACONTAINER { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("QACONTAINER") .field("cbSize", &self.cbSize) .field("pClientSite", &self.pClientSite) .field("pAdviseSink", &self.pAdviseSink) .field("pPropertyNotifySink", &self.pPropertyNotifySink) .field("pUnkEventSink", &self.pUnkEventSink) .field("dwAmbientFlags", &self.dwAmbientFlags) .field("colorFore", &self.colorFore) .field("colorBack", &self.colorBack) .field("pFont", &self.pFont) .field("pUndoMgr", &self.pUndoMgr) .field("dwAppearance", &self.dwAppearance) .field("lcid", &self.lcid) .field("hpal", &self.hpal) .field("pBindHost", &self.pBindHost) .field("pOleControlSite", &self.pOleControlSite) .field("pServiceProvider", &self.pServiceProvider) .finish() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for QACONTAINER { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.pClientSite == other.pClientSite && self.pAdviseSink == other.pAdviseSink && self.pPropertyNotifySink == other.pPropertyNotifySink && self.pUnkEventSink == other.pUnkEventSink && self.dwAmbientFlags == other.dwAmbientFlags && self.colorFore == other.colorFore && self.colorBack == other.colorBack && self.pFont == other.pFont && self.pUndoMgr == other.pUndoMgr && self.dwAppearance == other.dwAppearance && self.lcid == other.lcid && self.hpal == other.hpal && self.pBindHost == other.pBindHost && self.pOleControlSite == other.pOleControlSite && self.pServiceProvider == other.pServiceProvider } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for QACONTAINER {} #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for QACONTAINER { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct QACONTAINERFLAGS(pub i32); pub const QACONTAINER_SHOWHATCHING: QACONTAINERFLAGS = QACONTAINERFLAGS(1i32); pub const QACONTAINER_SHOWGRABHANDLES: QACONTAINERFLAGS = QACONTAINERFLAGS(2i32); pub const QACONTAINER_USERMODE: QACONTAINERFLAGS = QACONTAINERFLAGS(4i32); pub const QACONTAINER_DISPLAYASDEFAULT: QACONTAINERFLAGS = QACONTAINERFLAGS(8i32); pub const QACONTAINER_UIDEAD: QACONTAINERFLAGS = QACONTAINERFLAGS(16i32); pub const QACONTAINER_AUTOCLIP: QACONTAINERFLAGS = QACONTAINERFLAGS(32i32); pub const QACONTAINER_MESSAGEREFLECT: QACONTAINERFLAGS = QACONTAINERFLAGS(64i32); pub const QACONTAINER_SUPPORTSMNEMONICS: QACONTAINERFLAGS = QACONTAINERFLAGS(128i32); impl ::core::convert::From<i32> for QACONTAINERFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for QACONTAINERFLAGS { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct QACONTROL { pub cbSize: u32, pub dwMiscStatus: u32, pub dwViewStatus: u32, pub dwEventCookie: u32, pub dwPropNotifyCookie: u32, pub dwPointerActivationPolicy: u32, } impl QACONTROL {} impl ::core::default::Default for QACONTROL { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for QACONTROL { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("QACONTROL") .field("cbSize", &self.cbSize) .field("dwMiscStatus", &self.dwMiscStatus) .field("dwViewStatus", &self.dwViewStatus) .field("dwEventCookie", &self.dwEventCookie) .field("dwPropNotifyCookie", &self.dwPropNotifyCookie) .field("dwPointerActivationPolicy", &self.dwPointerActivationPolicy) .finish() } } impl ::core::cmp::PartialEq for QACONTROL { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwMiscStatus == other.dwMiscStatus && self.dwViewStatus == other.dwViewStatus && self.dwEventCookie == other.dwEventCookie && self.dwPropNotifyCookie == other.dwPropNotifyCookie && self.dwPointerActivationPolicy == other.dwPointerActivationPolicy } } impl ::core::cmp::Eq for QACONTROL {} unsafe impl ::windows::core::Abi for QACONTROL { type Abi = Self; } #[inline] pub unsafe fn QueryPathOfRegTypeLib(guid: *const ::windows::core::GUID, wmaj: u16, wmin: u16, lcid: u32) -> ::windows::core::Result<*mut u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn QueryPathOfRegTypeLib(guid: *const ::windows::core::GUID, wmaj: u16, wmin: u16, lcid: u32, lpbstrpathname: *mut *mut u16) -> ::windows::core::HRESULT; } let mut result__: <*mut u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); QueryPathOfRegTypeLib(::core::mem::transmute(guid), ::core::mem::transmute(wmaj), ::core::mem::transmute(wmin), ::core::mem::transmute(lcid), &mut result__).from_abi::<*mut u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct READYSTATE(pub i32); pub const READYSTATE_UNINITIALIZED: READYSTATE = READYSTATE(0i32); pub const READYSTATE_LOADING: READYSTATE = READYSTATE(1i32); pub const READYSTATE_LOADED: READYSTATE = READYSTATE(2i32); pub const READYSTATE_INTERACTIVE: READYSTATE = READYSTATE(3i32); pub const READYSTATE_COMPLETE: READYSTATE = READYSTATE(4i32); impl ::core::convert::From<i32> for READYSTATE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for READYSTATE { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct REGKIND(pub i32); pub const REGKIND_DEFAULT: REGKIND = REGKIND(0i32); pub const REGKIND_REGISTER: REGKIND = REGKIND(1i32); pub const REGKIND_NONE: REGKIND = REGKIND(2i32); impl ::core::convert::From<i32> for REGKIND { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for REGKIND { type Abi = Self; } #[inline] pub unsafe fn RegisterActiveObject<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(punk: Param0, rclsid: *const ::windows::core::GUID, dwflags: u32, pdwregister: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RegisterActiveObject(punk: ::windows::core::RawPtr, rclsid: *const ::windows::core::GUID, dwflags: u32, pdwregister: *mut u32) -> ::windows::core::HRESULT; } RegisterActiveObject(punk.into_param().abi(), ::core::mem::transmute(rclsid), ::core::mem::transmute(dwflags), ::core::mem::transmute(pdwregister)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn RegisterDragDrop<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, IDropTarget>>(hwnd: Param0, pdroptarget: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RegisterDragDrop(hwnd: super::super::Foundation::HWND, pdroptarget: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } RegisterDragDrop(hwnd.into_param().abi(), pdroptarget.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn RegisterTypeLib<'a, Param0: ::windows::core::IntoParam<'a, super::Com::ITypeLib>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(ptlib: Param0, szfullpath: Param1, szhelpdir: Param2) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RegisterTypeLib(ptlib: ::windows::core::RawPtr, szfullpath: super::super::Foundation::PWSTR, szhelpdir: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT; } RegisterTypeLib(ptlib.into_param().abi(), szfullpath.into_param().abi(), szhelpdir.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn RegisterTypeLibForUser<'a, Param0: ::windows::core::IntoParam<'a, super::Com::ITypeLib>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(ptlib: Param0, szfullpath: Param1, szhelpdir: Param2) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RegisterTypeLibForUser(ptlib: ::windows::core::RawPtr, szfullpath: super::super::Foundation::PWSTR, szhelpdir: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT; } RegisterTypeLibForUser(ptlib.into_param().abi(), szfullpath.into_param().abi(), szhelpdir.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_System_Com", feature = "Win32_System_Com_StructuredStorage"))] #[inline] pub unsafe fn ReleaseStgMedium(param0: *mut super::Com::STGMEDIUM) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ReleaseStgMedium(param0: *mut ::core::mem::ManuallyDrop<super::Com::STGMEDIUM>); } ::core::mem::transmute(ReleaseStgMedium(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn RevokeActiveObject(dwregister: u32, pvreserved: *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RevokeActiveObject(dwregister: u32, pvreserved: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } RevokeActiveObject(::core::mem::transmute(dwregister), ::core::mem::transmute(pvreserved)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn RevokeDragDrop<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RevokeDragDrop(hwnd: super::super::Foundation::HWND) -> ::windows::core::HRESULT; } RevokeDragDrop(hwnd.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const SELFREG_E_CLASS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220991i32 as _); pub const SELFREG_E_FIRST: i32 = -2147220992i32; pub const SELFREG_E_LAST: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220977i32 as _); pub const SELFREG_E_TYPELIB: ::windows::core::HRESULT = ::windows::core::HRESULT(-2147220992i32 as _); pub const SELFREG_S_FIRST: ::windows::core::HRESULT = ::windows::core::HRESULT(262656i32 as _); pub const SELFREG_S_LAST: ::windows::core::HRESULT = ::windows::core::HRESULT(262671i32 as _); #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct SF_TYPE(pub i32); pub const SF_ERROR: SF_TYPE = SF_TYPE(10i32); pub const SF_I1: SF_TYPE = SF_TYPE(16i32); pub const SF_I2: SF_TYPE = SF_TYPE(2i32); pub const SF_I4: SF_TYPE = SF_TYPE(3i32); pub const SF_I8: SF_TYPE = SF_TYPE(20i32); pub const SF_BSTR: SF_TYPE = SF_TYPE(8i32); pub const SF_UNKNOWN: SF_TYPE = SF_TYPE(13i32); pub const SF_DISPATCH: SF_TYPE = SF_TYPE(9i32); pub const SF_VARIANT: SF_TYPE = SF_TYPE(12i32); pub const SF_RECORD: SF_TYPE = SF_TYPE(36i32); pub const SF_HAVEIID: SF_TYPE = SF_TYPE(32781i32); impl ::core::convert::From<i32> for SF_TYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for SF_TYPE { type Abi = Self; } pub const SID_GetCaller: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4717cc40_bcb9_11d0_9336_00a0c90dcaa9); pub const SID_ProvideRuntimeContext: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x74a5040c_dd0c_48f0_ac85_194c3259180a); pub const SID_VariantConversion: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1f101481_bccd_11d0_9336_00a0c90dcaa9); pub const STDOLE2_LCID: u32 = 0u32; pub const STDOLE2_MAJORVERNUM: u32 = 2u32; pub const STDOLE2_MINORVERNUM: u32 = 0u32; pub const STDOLE_LCID: u32 = 0u32; pub const STDOLE_MAJORVERNUM: u32 = 1u32; pub const STDOLE_MINORVERNUM: u32 = 0u32; #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayAccessData(psa: *const super::Com::SAFEARRAY, ppvdata: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayAccessData(psa: *const super::Com::SAFEARRAY, ppvdata: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } SafeArrayAccessData(::core::mem::transmute(psa), ::core::mem::transmute(ppvdata)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayAddRef(psa: *const super::Com::SAFEARRAY, ppdatatorelease: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayAddRef(psa: *const super::Com::SAFEARRAY, ppdatatorelease: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } SafeArrayAddRef(::core::mem::transmute(psa), ::core::mem::transmute(ppdatatorelease)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayAllocData(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayAllocData(psa: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayAllocData(::core::mem::transmute(psa)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayAllocDescriptor(cdims: u32) -> ::windows::core::Result<*mut super::Com::SAFEARRAY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayAllocDescriptor(cdims: u32, ppsaout: *mut *mut super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } let mut result__: <*mut super::Com::SAFEARRAY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayAllocDescriptor(::core::mem::transmute(cdims), &mut result__).from_abi::<*mut super::Com::SAFEARRAY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayAllocDescriptorEx(vt: u16, cdims: u32) -> ::windows::core::Result<*mut super::Com::SAFEARRAY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayAllocDescriptorEx(vt: u16, cdims: u32, ppsaout: *mut *mut super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } let mut result__: <*mut super::Com::SAFEARRAY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayAllocDescriptorEx(::core::mem::transmute(vt), ::core::mem::transmute(cdims), &mut result__).from_abi::<*mut super::Com::SAFEARRAY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayCopy(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<*mut super::Com::SAFEARRAY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayCopy(psa: *const super::Com::SAFEARRAY, ppsaout: *mut *mut super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } let mut result__: <*mut super::Com::SAFEARRAY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayCopy(::core::mem::transmute(psa), &mut result__).from_abi::<*mut super::Com::SAFEARRAY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayCopyData(psasource: *const super::Com::SAFEARRAY, psatarget: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayCopyData(psasource: *const super::Com::SAFEARRAY, psatarget: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayCopyData(::core::mem::transmute(psasource), ::core::mem::transmute(psatarget)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayCreate(vt: u16, cdims: u32, rgsabound: *const super::Com::SAFEARRAYBOUND) -> *mut super::Com::SAFEARRAY { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayCreate(vt: u16, cdims: u32, rgsabound: *const super::Com::SAFEARRAYBOUND) -> *mut super::Com::SAFEARRAY; } ::core::mem::transmute(SafeArrayCreate(::core::mem::transmute(vt), ::core::mem::transmute(cdims), ::core::mem::transmute(rgsabound))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayCreateEx(vt: u16, cdims: u32, rgsabound: *const super::Com::SAFEARRAYBOUND, pvextra: *const ::core::ffi::c_void) -> *mut super::Com::SAFEARRAY { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayCreateEx(vt: u16, cdims: u32, rgsabound: *const super::Com::SAFEARRAYBOUND, pvextra: *const ::core::ffi::c_void) -> *mut super::Com::SAFEARRAY; } ::core::mem::transmute(SafeArrayCreateEx(::core::mem::transmute(vt), ::core::mem::transmute(cdims), ::core::mem::transmute(rgsabound), ::core::mem::transmute(pvextra))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayCreateVector(vt: u16, llbound: i32, celements: u32) -> *mut super::Com::SAFEARRAY { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayCreateVector(vt: u16, llbound: i32, celements: u32) -> *mut super::Com::SAFEARRAY; } ::core::mem::transmute(SafeArrayCreateVector(::core::mem::transmute(vt), ::core::mem::transmute(llbound), ::core::mem::transmute(celements))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayCreateVectorEx(vt: u16, llbound: i32, celements: u32, pvextra: *const ::core::ffi::c_void) -> *mut super::Com::SAFEARRAY { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayCreateVectorEx(vt: u16, llbound: i32, celements: u32, pvextra: *const ::core::ffi::c_void) -> *mut super::Com::SAFEARRAY; } ::core::mem::transmute(SafeArrayCreateVectorEx(::core::mem::transmute(vt), ::core::mem::transmute(llbound), ::core::mem::transmute(celements), ::core::mem::transmute(pvextra))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayDestroy(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayDestroy(psa: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayDestroy(::core::mem::transmute(psa)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayDestroyData(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayDestroyData(psa: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayDestroyData(::core::mem::transmute(psa)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayDestroyDescriptor(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayDestroyDescriptor(psa: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayDestroyDescriptor(::core::mem::transmute(psa)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetDim(psa: *const super::Com::SAFEARRAY) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetDim(psa: *const super::Com::SAFEARRAY) -> u32; } ::core::mem::transmute(SafeArrayGetDim(::core::mem::transmute(psa))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetElement(psa: *const super::Com::SAFEARRAY, rgindices: *const i32, pv: *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetElement(psa: *const super::Com::SAFEARRAY, rgindices: *const i32, pv: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } SafeArrayGetElement(::core::mem::transmute(psa), ::core::mem::transmute(rgindices), ::core::mem::transmute(pv)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetElemsize(psa: *const super::Com::SAFEARRAY) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetElemsize(psa: *const super::Com::SAFEARRAY) -> u32; } ::core::mem::transmute(SafeArrayGetElemsize(::core::mem::transmute(psa))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetIID(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<::windows::core::GUID> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetIID(psa: *const super::Com::SAFEARRAY, pguid: *mut ::windows::core::GUID) -> ::windows::core::HRESULT; } let mut result__: <::windows::core::GUID as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayGetIID(::core::mem::transmute(psa), &mut result__).from_abi::<::windows::core::GUID>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetLBound(psa: *const super::Com::SAFEARRAY, ndim: u32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetLBound(psa: *const super::Com::SAFEARRAY, ndim: u32, pllbound: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayGetLBound(::core::mem::transmute(psa), ::core::mem::transmute(ndim), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetRecordInfo(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<IRecordInfo> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetRecordInfo(psa: *const super::Com::SAFEARRAY, prinfo: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT; } let mut result__: <IRecordInfo as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayGetRecordInfo(::core::mem::transmute(psa), &mut result__).from_abi::<IRecordInfo>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetUBound(psa: *const super::Com::SAFEARRAY, ndim: u32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetUBound(psa: *const super::Com::SAFEARRAY, ndim: u32, plubound: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayGetUBound(::core::mem::transmute(psa), ::core::mem::transmute(ndim), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayGetVartype(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayGetVartype(psa: *const super::Com::SAFEARRAY, pvt: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); SafeArrayGetVartype(::core::mem::transmute(psa), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayLock(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayLock(psa: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayLock(::core::mem::transmute(psa)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayPtrOfIndex(psa: *const super::Com::SAFEARRAY, rgindices: *const i32, ppvdata: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayPtrOfIndex(psa: *const super::Com::SAFEARRAY, rgindices: *const i32, ppvdata: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } SafeArrayPtrOfIndex(::core::mem::transmute(psa), ::core::mem::transmute(rgindices), ::core::mem::transmute(ppvdata)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayPutElement(psa: *const super::Com::SAFEARRAY, rgindices: *const i32, pv: *const ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayPutElement(psa: *const super::Com::SAFEARRAY, rgindices: *const i32, pv: *const ::core::ffi::c_void) -> ::windows::core::HRESULT; } SafeArrayPutElement(::core::mem::transmute(psa), ::core::mem::transmute(rgindices), ::core::mem::transmute(pv)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayRedim(psa: *mut super::Com::SAFEARRAY, psaboundnew: *const super::Com::SAFEARRAYBOUND) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayRedim(psa: *mut super::Com::SAFEARRAY, psaboundnew: *const super::Com::SAFEARRAYBOUND) -> ::windows::core::HRESULT; } SafeArrayRedim(::core::mem::transmute(psa), ::core::mem::transmute(psaboundnew)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn SafeArrayReleaseData(pdata: *const ::core::ffi::c_void) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayReleaseData(pdata: *const ::core::ffi::c_void); } ::core::mem::transmute(SafeArrayReleaseData(::core::mem::transmute(pdata))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayReleaseDescriptor(psa: *const super::Com::SAFEARRAY) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayReleaseDescriptor(psa: *const super::Com::SAFEARRAY); } ::core::mem::transmute(SafeArrayReleaseDescriptor(::core::mem::transmute(psa))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArraySetIID(psa: *const super::Com::SAFEARRAY, guid: *const ::windows::core::GUID) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArraySetIID(psa: *const super::Com::SAFEARRAY, guid: *const ::windows::core::GUID) -> ::windows::core::HRESULT; } SafeArraySetIID(::core::mem::transmute(psa), ::core::mem::transmute(guid)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArraySetRecordInfo<'a, Param1: ::windows::core::IntoParam<'a, IRecordInfo>>(psa: *const super::Com::SAFEARRAY, prinfo: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArraySetRecordInfo(psa: *const super::Com::SAFEARRAY, prinfo: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } SafeArraySetRecordInfo(::core::mem::transmute(psa), prinfo.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayUnaccessData(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayUnaccessData(psa: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayUnaccessData(::core::mem::transmute(psa)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn SafeArrayUnlock(psa: *const super::Com::SAFEARRAY) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SafeArrayUnlock(psa: *const super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } SafeArrayUnlock(::core::mem::transmute(psa)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn SystemTimeToVariantTime(lpsystemtime: *const super::super::Foundation::SYSTEMTIME, pvtime: *mut f64) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SystemTimeToVariantTime(lpsystemtime: *const super::super::Foundation::SYSTEMTIME, pvtime: *mut f64) -> i32; } ::core::mem::transmute(SystemTimeToVariantTime(::core::mem::transmute(lpsystemtime), ::core::mem::transmute(pvtime))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const TIFLAGS_EXTENDDISPATCHONLY: u32 = 1u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct TYPEFLAGS(pub i32); pub const TYPEFLAG_FAPPOBJECT: TYPEFLAGS = TYPEFLAGS(1i32); pub const TYPEFLAG_FCANCREATE: TYPEFLAGS = TYPEFLAGS(2i32); pub const TYPEFLAG_FLICENSED: TYPEFLAGS = TYPEFLAGS(4i32); pub const TYPEFLAG_FPREDECLID: TYPEFLAGS = TYPEFLAGS(8i32); pub const TYPEFLAG_FHIDDEN: TYPEFLAGS = TYPEFLAGS(16i32); pub const TYPEFLAG_FCONTROL: TYPEFLAGS = TYPEFLAGS(32i32); pub const TYPEFLAG_FDUAL: TYPEFLAGS = TYPEFLAGS(64i32); pub const TYPEFLAG_FNONEXTENSIBLE: TYPEFLAGS = TYPEFLAGS(128i32); pub const TYPEFLAG_FOLEAUTOMATION: TYPEFLAGS = TYPEFLAGS(256i32); pub const TYPEFLAG_FRESTRICTED: TYPEFLAGS = TYPEFLAGS(512i32); pub const TYPEFLAG_FAGGREGATABLE: TYPEFLAGS = TYPEFLAGS(1024i32); pub const TYPEFLAG_FREPLACEABLE: TYPEFLAGS = TYPEFLAGS(2048i32); pub const TYPEFLAG_FDISPATCHABLE: TYPEFLAGS = TYPEFLAGS(4096i32); pub const TYPEFLAG_FREVERSEBIND: TYPEFLAGS = TYPEFLAGS(8192i32); pub const TYPEFLAG_FPROXY: TYPEFLAGS = TYPEFLAGS(16384i32); impl ::core::convert::From<i32> for TYPEFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TYPEFLAGS { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct UASFLAGS(pub i32); pub const UAS_NORMAL: UASFLAGS = UASFLAGS(0i32); pub const UAS_BLOCKED: UASFLAGS = UASFLAGS(1i32); pub const UAS_NOPARENTENABLE: UASFLAGS = UASFLAGS(2i32); pub const UAS_MASK: UASFLAGS = UASFLAGS(3i32); impl ::core::convert::From<i32> for UASFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for UASFLAGS { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct UDATE { pub st: super::super::Foundation::SYSTEMTIME, pub wDayOfYear: u16, } #[cfg(feature = "Win32_Foundation")] impl UDATE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for UDATE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for UDATE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("UDATE").field("st", &self.st).field("wDayOfYear", &self.wDayOfYear).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for UDATE { fn eq(&self, other: &Self) -> bool { self.st == other.st && self.wDayOfYear == other.wDayOfYear } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for UDATE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for UDATE { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct UPDFCACHE_FLAGS(pub u32); pub const UPDFCACHE_ALL: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(2147483647u32); pub const UPDFCACHE_ALLBUTNODATACACHE: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(2147483646u32); pub const UPDFCACHE_NORMALCACHE: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(8u32); pub const UPDFCACHE_IFBLANK: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(16u32); pub const UPDFCACHE_ONLYIFBLANK: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(2147483648u32); pub const UPDFCACHE_NODATACACHE: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(1u32); pub const UPDFCACHE_ONSAVECACHE: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(2u32); pub const UPDFCACHE_ONSTOPCACHE: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(4u32); pub const UPDFCACHE_IFBLANKORONSAVECACHE: UPDFCACHE_FLAGS = UPDFCACHE_FLAGS(18u32); impl ::core::convert::From<u32> for UPDFCACHE_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for UPDFCACHE_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for UPDFCACHE_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for UPDFCACHE_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for UPDFCACHE_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for UPDFCACHE_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for UPDFCACHE_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct USERCLASSTYPE(pub i32); pub const USERCLASSTYPE_FULL: USERCLASSTYPE = USERCLASSTYPE(1i32); pub const USERCLASSTYPE_SHORT: USERCLASSTYPE = USERCLASSTYPE(2i32); pub const USERCLASSTYPE_APPNAME: USERCLASSTYPE = USERCLASSTYPE(3i32); impl ::core::convert::From<i32> for USERCLASSTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for USERCLASSTYPE { type Abi = Self; } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn UnRegisterTypeLib(libid: *const ::windows::core::GUID, wvermajor: u16, wverminor: u16, lcid: u32, syskind: super::Com::SYSKIND) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn UnRegisterTypeLib(libid: *const ::windows::core::GUID, wvermajor: u16, wverminor: u16, lcid: u32, syskind: super::Com::SYSKIND) -> ::windows::core::HRESULT; } UnRegisterTypeLib(::core::mem::transmute(libid), ::core::mem::transmute(wvermajor), ::core::mem::transmute(wverminor), ::core::mem::transmute(lcid), ::core::mem::transmute(syskind)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn UnRegisterTypeLibForUser(libid: *const ::windows::core::GUID, wmajorvernum: u16, wminorvernum: u16, lcid: u32, syskind: super::Com::SYSKIND) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn UnRegisterTypeLibForUser(libid: *const ::windows::core::GUID, wmajorvernum: u16, wminorvernum: u16, lcid: u32, syskind: super::Com::SYSKIND) -> ::windows::core::HRESULT; } UnRegisterTypeLibForUser(::core::mem::transmute(libid), ::core::mem::transmute(wmajorvernum), ::core::mem::transmute(wminorvernum), ::core::mem::transmute(lcid), ::core::mem::transmute(syskind)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const VARCMP_EQ: u32 = 1u32; pub const VARCMP_GT: u32 = 2u32; pub const VARCMP_LT: u32 = 0u32; pub const VARCMP_NULL: u32 = 3u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct VARENUM(pub i32); pub const VT_EMPTY: VARENUM = VARENUM(0i32); pub const VT_NULL: VARENUM = VARENUM(1i32); pub const VT_I2: VARENUM = VARENUM(2i32); pub const VT_I4: VARENUM = VARENUM(3i32); pub const VT_R4: VARENUM = VARENUM(4i32); pub const VT_R8: VARENUM = VARENUM(5i32); pub const VT_CY: VARENUM = VARENUM(6i32); pub const VT_DATE: VARENUM = VARENUM(7i32); pub const VT_BSTR: VARENUM = VARENUM(8i32); pub const VT_DISPATCH: VARENUM = VARENUM(9i32); pub const VT_ERROR: VARENUM = VARENUM(10i32); pub const VT_BOOL: VARENUM = VARENUM(11i32); pub const VT_VARIANT: VARENUM = VARENUM(12i32); pub const VT_UNKNOWN: VARENUM = VARENUM(13i32); pub const VT_DECIMAL: VARENUM = VARENUM(14i32); pub const VT_I1: VARENUM = VARENUM(16i32); pub const VT_UI1: VARENUM = VARENUM(17i32); pub const VT_UI2: VARENUM = VARENUM(18i32); pub const VT_UI4: VARENUM = VARENUM(19i32); pub const VT_I8: VARENUM = VARENUM(20i32); pub const VT_UI8: VARENUM = VARENUM(21i32); pub const VT_INT: VARENUM = VARENUM(22i32); pub const VT_UINT: VARENUM = VARENUM(23i32); pub const VT_VOID: VARENUM = VARENUM(24i32); pub const VT_HRESULT: VARENUM = VARENUM(25i32); pub const VT_PTR: VARENUM = VARENUM(26i32); pub const VT_SAFEARRAY: VARENUM = VARENUM(27i32); pub const VT_CARRAY: VARENUM = VARENUM(28i32); pub const VT_USERDEFINED: VARENUM = VARENUM(29i32); pub const VT_LPSTR: VARENUM = VARENUM(30i32); pub const VT_LPWSTR: VARENUM = VARENUM(31i32); pub const VT_RECORD: VARENUM = VARENUM(36i32); pub const VT_INT_PTR: VARENUM = VARENUM(37i32); pub const VT_UINT_PTR: VARENUM = VARENUM(38i32); pub const VT_FILETIME: VARENUM = VARENUM(64i32); pub const VT_BLOB: VARENUM = VARENUM(65i32); pub const VT_STREAM: VARENUM = VARENUM(66i32); pub const VT_STORAGE: VARENUM = VARENUM(67i32); pub const VT_STREAMED_OBJECT: VARENUM = VARENUM(68i32); pub const VT_STORED_OBJECT: VARENUM = VARENUM(69i32); pub const VT_BLOB_OBJECT: VARENUM = VARENUM(70i32); pub const VT_CF: VARENUM = VARENUM(71i32); pub const VT_CLSID: VARENUM = VARENUM(72i32); pub const VT_VERSIONED_STREAM: VARENUM = VARENUM(73i32); pub const VT_BSTR_BLOB: VARENUM = VARENUM(4095i32); pub const VT_VECTOR: VARENUM = VARENUM(4096i32); pub const VT_ARRAY: VARENUM = VARENUM(8192i32); pub const VT_BYREF: VARENUM = VARENUM(16384i32); pub const VT_RESERVED: VARENUM = VARENUM(32768i32); pub const VT_ILLEGAL: VARENUM = VARENUM(65535i32); pub const VT_ILLEGALMASKED: VARENUM = VARENUM(4095i32); pub const VT_TYPEMASK: VARENUM = VARENUM(4095i32); impl ::core::convert::From<i32> for VARENUM { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for VARENUM { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct VARFLAGS(pub i32); pub const VARFLAG_FREADONLY: VARFLAGS = VARFLAGS(1i32); pub const VARFLAG_FSOURCE: VARFLAGS = VARFLAGS(2i32); pub const VARFLAG_FBINDABLE: VARFLAGS = VARFLAGS(4i32); pub const VARFLAG_FREQUESTEDIT: VARFLAGS = VARFLAGS(8i32); pub const VARFLAG_FDISPLAYBIND: VARFLAGS = VARFLAGS(16i32); pub const VARFLAG_FDEFAULTBIND: VARFLAGS = VARFLAGS(32i32); pub const VARFLAG_FHIDDEN: VARFLAGS = VARFLAGS(64i32); pub const VARFLAG_FRESTRICTED: VARFLAGS = VARFLAGS(128i32); pub const VARFLAG_FDEFAULTCOLLELEM: VARFLAGS = VARFLAGS(256i32); pub const VARFLAG_FUIDEFAULT: VARFLAGS = VARFLAGS(512i32); pub const VARFLAG_FNONBROWSABLE: VARFLAGS = VARFLAGS(1024i32); pub const VARFLAG_FREPLACEABLE: VARFLAGS = VARFLAGS(2048i32); pub const VARFLAG_FIMMEDIATEBIND: VARFLAGS = VARFLAGS(4096i32); impl ::core::convert::From<i32> for VARFLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for VARFLAGS { type Abi = Self; } pub const VARIANT_ALPHABOOL: u32 = 2u32; pub const VARIANT_CALENDAR_GREGORIAN: u32 = 64u32; pub const VARIANT_CALENDAR_HIJRI: u32 = 8u32; pub const VARIANT_CALENDAR_THAI: u32 = 32u32; pub const VARIANT_LOCALBOOL: u32 = 16u32; pub const VARIANT_NOUSEROVERRIDE: u32 = 4u32; pub const VARIANT_NOVALUEPROP: u32 = 1u32; pub const VARIANT_USE_NLS: u32 = 128u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct VIEWSTATUS(pub i32); pub const VIEWSTATUS_OPAQUE: VIEWSTATUS = VIEWSTATUS(1i32); pub const VIEWSTATUS_SOLIDBKGND: VIEWSTATUS = VIEWSTATUS(2i32); pub const VIEWSTATUS_DVASPECTOPAQUE: VIEWSTATUS = VIEWSTATUS(4i32); pub const VIEWSTATUS_DVASPECTTRANSPARENT: VIEWSTATUS = VIEWSTATUS(8i32); pub const VIEWSTATUS_SURFACE: VIEWSTATUS = VIEWSTATUS(16i32); pub const VIEWSTATUS_3DSURFACE: VIEWSTATUS = VIEWSTATUS(32i32); impl ::core::convert::From<i32> for VIEWSTATUS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for VIEWSTATUS { type Abi = Self; } pub const VPF_DISABLERELATIVE: i32 = 2i32; pub const VPF_DISABLESCALE: i32 = 4i32; pub const VPF_SELECTRELATIVE: i32 = 1i32; pub const VTDATEGRE_MAX: u32 = 2958465u32; pub const VTDATEGRE_MIN: i32 = -657434i32; pub const VT_BLOB_PROPSET: u32 = 75u32; pub const VT_STORED_PROPSET: u32 = 74u32; pub const VT_STREAMED_PROPSET: u32 = 73u32; pub const VT_VERBOSE_ENUM: u32 = 76u32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarAbs(pvarin: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarAbs(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarAbs(::core::mem::transmute(pvarin), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarAdd(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarAdd(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarAdd(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarAnd(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarAnd(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarAnd(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarBoolFromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromCy(cyin: super::Com::CY, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromCy(cyin.into_param().abi(), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromDate(datein: f64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromDate(datein: f64, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromDate(::core::mem::transmute(datein), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBoolFromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromDec(pdecin: *const super::super::Foundation::DECIMAL, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarBoolFromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBoolFromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromI1(cin: super::super::Foundation::CHAR, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromI1(cin.into_param().abi(), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromI2(sin: i16) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromI2(sin: i16, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromI2(::core::mem::transmute(sin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromI4(lin: i32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromI4(lin: i32, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromI4(::core::mem::transmute(lin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromI8(i64in: i64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromI8(i64in: i64, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromR4(fltin: f32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromR4(fltin: f32, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromR8(dblin: f64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromR8(dblin: f64, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBoolFromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromUI1(bin: u8) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromUI1(bin: u8, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromUI2(uiin: u16) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromUI2(uiin: u16, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromUI4(ulin: u32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromUI4(ulin: u32, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarBoolFromUI8(i64in: u64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBoolFromUI8(i64in: u64, pboolout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBoolFromUI8(::core::mem::transmute(i64in), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrCat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(bstrleft: Param0, bstrright: Param1) -> ::windows::core::Result<*mut u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrCat(bstrleft: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, bstrright: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, pbstrresult: *mut *mut u16) -> ::windows::core::HRESULT; } let mut result__: <*mut u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrCat(bstrleft.into_param().abi(), bstrright.into_param().abi(), &mut result__).from_abi::<*mut u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrCmp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(bstrleft: Param0, bstrright: Param1, lcid: u32, dwflags: u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrCmp(bstrleft: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, bstrright: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, lcid: u32, dwflags: u32) -> ::windows::core::HRESULT; } VarBstrCmp(bstrleft.into_param().abi(), bstrright.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromBool(boolin: i16, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromBool(boolin: i16, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromBool(::core::mem::transmute(boolin), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarBstrFromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromCy(cyin: super::Com::CY, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromCy(cyin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromDate(datein: f64, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromDate(datein: f64, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromDate(::core::mem::transmute(datein), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromDec(pdecin: *const super::super::Foundation::DECIMAL, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromDec(pdecin: *const super::super::Foundation::DECIMAL, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromDec(::core::mem::transmute(pdecin), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarBstrFromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromI1(cin: super::super::Foundation::CHAR, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromI1(cin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromI2(ival: i16, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromI2(ival: i16, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromI2(::core::mem::transmute(ival), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromI4(lin: i32, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromI4(lin: i32, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromI4(::core::mem::transmute(lin), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromI8(i64in: i64, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromI8(i64in: i64, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromI8(::core::mem::transmute(i64in), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromR4(fltin: f32, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromR4(fltin: f32, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromR4(::core::mem::transmute(fltin), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromR8(dblin: f64, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromR8(dblin: f64, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromR8(::core::mem::transmute(dblin), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromUI1(bval: u8, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromUI1(bval: u8, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromUI1(::core::mem::transmute(bval), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromUI2(uiin: u16, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromUI2(uiin: u16, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromUI2(::core::mem::transmute(uiin), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromUI4(ulin: u32, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromUI4(ulin: u32, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromUI4(::core::mem::transmute(ulin), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarBstrFromUI8(ui64in: u64, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarBstrFromUI8(ui64in: u64, lcid: u32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarBstrFromUI8(::core::mem::transmute(ui64in), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarCat(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCat(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCat(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarCmp(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT, lcid: u32, dwflags: u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCmp(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, lcid: u32, dwflags: u32) -> ::windows::core::HRESULT; } VarCmp(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyAbs<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyAbs(cyin: super::Com::CY, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyAbs(cyin.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyAdd<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>, Param1: ::windows::core::IntoParam<'a, super::Com::CY>>(cyleft: Param0, cyright: Param1) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyAdd(cyleft: super::Com::CY, cyright: super::Com::CY, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyAdd(cyleft.into_param().abi(), cyright.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyCmp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>, Param1: ::windows::core::IntoParam<'a, super::Com::CY>>(cyleft: Param0, cyright: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyCmp(cyleft: super::Com::CY, cyright: super::Com::CY) -> ::windows::core::HRESULT; } VarCyCmp(cyleft.into_param().abi(), cyright.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyCmpR8<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyleft: Param0, dblright: f64) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyCmpR8(cyleft: super::Com::CY, dblright: f64) -> ::windows::core::HRESULT; } VarCyCmpR8(cyleft.into_param().abi(), ::core::mem::transmute(dblright)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFix<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFix(cyin: super::Com::CY, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFix(cyin.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromBool(boolin: i16) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromBool(boolin: i16, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromDate(datein: f64) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromDate(datein: f64, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromDate(::core::mem::transmute(datein), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarCyFromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromDec(pdecin: *const super::super::Foundation::DECIMAL, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarCyFromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromI1(cin: super::super::Foundation::CHAR, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromI1(cin.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromI2(sin: i16) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromI2(sin: i16, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromI2(::core::mem::transmute(sin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromI4(lin: i32) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromI4(lin: i32, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromI4(::core::mem::transmute(lin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromI8(i64in: i64) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromI8(i64in: i64, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromR4(fltin: f32) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromR4(fltin: f32, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromR8(dblin: f64) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromR8(dblin: f64, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarCyFromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromUI1(bin: u8) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromUI1(bin: u8, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromUI2(uiin: u16) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromUI2(uiin: u16, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromUI4(ulin: u32) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromUI4(ulin: u32, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyFromUI8(ui64in: u64) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyFromUI8(ui64in: u64, pcyout: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyFromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyInt<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyInt(cyin: super::Com::CY, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyInt(cyin.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyMul<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>, Param1: ::windows::core::IntoParam<'a, super::Com::CY>>(cyleft: Param0, cyright: Param1) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyMul(cyleft: super::Com::CY, cyright: super::Com::CY, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyMul(cyleft.into_param().abi(), cyright.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyMulI4<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyleft: Param0, lright: i32) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyMulI4(cyleft: super::Com::CY, lright: i32, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyMulI4(cyleft.into_param().abi(), ::core::mem::transmute(lright), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyMulI8<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyleft: Param0, lright: i64) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyMulI8(cyleft: super::Com::CY, lright: i64, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyMulI8(cyleft.into_param().abi(), ::core::mem::transmute(lright), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyNeg<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyNeg(cyin: super::Com::CY, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyNeg(cyin.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCyRound<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0, cdecimals: i32) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCyRound(cyin: super::Com::CY, cdecimals: i32, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCyRound(cyin.into_param().abi(), ::core::mem::transmute(cdecimals), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarCySub<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>, Param1: ::windows::core::IntoParam<'a, super::Com::CY>>(cyleft: Param0, cyright: Param1) -> ::windows::core::Result<super::Com::CY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarCySub(cyleft: super::Com::CY, cyright: super::Com::CY, pcyresult: *mut super::Com::CY) -> ::windows::core::HRESULT; } let mut result__: <super::Com::CY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarCySub(cyleft.into_param().abi(), cyright.into_param().abi(), &mut result__).from_abi::<super::Com::CY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromBool(boolin: i16) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromBool(boolin: i16, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarDateFromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromCy(cyin: super::Com::CY, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromCy(cyin.into_param().abi(), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDateFromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromDec(pdecin: *const super::super::Foundation::DECIMAL, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarDateFromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDateFromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromI1(cin: super::super::Foundation::CHAR, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromI1(cin.into_param().abi(), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromI2(sin: i16) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromI2(sin: i16, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromI2(::core::mem::transmute(sin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromI4(lin: i32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromI4(lin: i32, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromI4(::core::mem::transmute(lin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromI8(i64in: i64) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromI8(i64in: i64, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromR4(fltin: f32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromR4(fltin: f32, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromR8(dblin: f64) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromR8(dblin: f64, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDateFromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromUI1(bin: u8) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromUI1(bin: u8, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromUI2(uiin: u16) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromUI2(uiin: u16, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromUI4(ulin: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromUI4(ulin: u32, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarDateFromUI8(ui64in: u64) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromUI8(ui64in: u64, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDateFromUdate(pudatein: *const UDATE, dwflags: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromUdate(pudatein: *const UDATE, dwflags: u32, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromUdate(::core::mem::transmute(pudatein), ::core::mem::transmute(dwflags), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDateFromUdateEx(pudatein: *const UDATE, lcid: u32, dwflags: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDateFromUdateEx(pudatein: *const UDATE, lcid: u32, dwflags: u32, pdateout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDateFromUdateEx(::core::mem::transmute(pudatein), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecAbs(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecAbs(pdecin: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecAbs(::core::mem::transmute(pdecin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecAdd(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecAdd(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecAdd(::core::mem::transmute(pdecleft), ::core::mem::transmute(pdecright), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecCmp(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecCmp(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } VarDecCmp(::core::mem::transmute(pdecleft), ::core::mem::transmute(pdecright)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecCmpR8(pdecleft: *const super::super::Foundation::DECIMAL, dblright: f64) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecCmpR8(pdecleft: *const super::super::Foundation::DECIMAL, dblright: f64) -> ::windows::core::HRESULT; } VarDecCmpR8(::core::mem::transmute(pdecleft), ::core::mem::transmute(dblright)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecDiv(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecDiv(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecDiv(::core::mem::transmute(pdecleft), ::core::mem::transmute(pdecright), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFix(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFix(pdecin: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFix(::core::mem::transmute(pdecin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromBool(boolin: i16) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromBool(boolin: i16, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarDecFromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromCy(cyin: super::Com::CY, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromCy(cyin.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromDate(datein: f64) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromDate(datein: f64, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromDate(::core::mem::transmute(datein), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarDecFromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromI1(cin: super::super::Foundation::CHAR, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromI1(cin.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromI2(uiin: i16) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromI2(uiin: i16, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromI2(::core::mem::transmute(uiin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromI4(lin: i32) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromI4(lin: i32, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromI4(::core::mem::transmute(lin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromI8(i64in: i64) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromI8(i64in: i64, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromR4(fltin: f32) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromR4(fltin: f32, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromR8(dblin: f64) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromR8(dblin: f64, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromUI1(bin: u8) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromUI1(bin: u8, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromUI2(uiin: u16) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromUI2(uiin: u16, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromUI4(ulin: u32) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromUI4(ulin: u32, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecFromUI8(ui64in: u64) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecFromUI8(ui64in: u64, pdecout: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecFromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecInt(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecInt(pdecin: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecInt(::core::mem::transmute(pdecin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecMul(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecMul(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecMul(::core::mem::transmute(pdecleft), ::core::mem::transmute(pdecright), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecNeg(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecNeg(pdecin: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecNeg(::core::mem::transmute(pdecin), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecRound(pdecin: *const super::super::Foundation::DECIMAL, cdecimals: i32) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecRound(pdecin: *const super::super::Foundation::DECIMAL, cdecimals: i32, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecRound(::core::mem::transmute(pdecin), ::core::mem::transmute(cdecimals), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarDecSub(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<super::super::Foundation::DECIMAL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDecSub(pdecleft: *const super::super::Foundation::DECIMAL, pdecright: *const super::super::Foundation::DECIMAL, pdecresult: *mut super::super::Foundation::DECIMAL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::DECIMAL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDecSub(::core::mem::transmute(pdecleft), ::core::mem::transmute(pdecright), &mut result__).from_abi::<super::super::Foundation::DECIMAL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarDiv(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarDiv(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarDiv(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarEqv(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarEqv(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarEqv(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarFix(pvarin: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarFix(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarFix(::core::mem::transmute(pvarin), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarFormat<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(pvarin: *const super::Com::VARIANT, pstrformat: Param1, ifirstday: i32, ifirstweek: i32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarFormat(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pstrformat: super::super::Foundation::PWSTR, ifirstday: i32, ifirstweek: i32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarFormat(::core::mem::transmute(pvarin), pstrformat.into_param().abi(), ::core::mem::transmute(ifirstday), ::core::mem::transmute(ifirstweek), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarFormatCurrency(pvarin: *const super::Com::VARIANT, inumdig: i32, iinclead: i32, iuseparens: i32, igroup: i32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarFormatCurrency(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, inumdig: i32, iinclead: i32, iuseparens: i32, igroup: i32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarFormatCurrency(::core::mem::transmute(pvarin), ::core::mem::transmute(inumdig), ::core::mem::transmute(iinclead), ::core::mem::transmute(iuseparens), ::core::mem::transmute(igroup), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarFormatDateTime(pvarin: *const super::Com::VARIANT, inamedformat: i32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarFormatDateTime(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, inamedformat: i32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarFormatDateTime(::core::mem::transmute(pvarin), ::core::mem::transmute(inamedformat), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarFormatFromTokens<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(pvarin: *const super::Com::VARIANT, pstrformat: Param1, pbtokcur: *const u8, dwflags: u32, pbstrout: *mut super::super::Foundation::BSTR, lcid: u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarFormatFromTokens(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pstrformat: super::super::Foundation::PWSTR, pbtokcur: *const u8, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, lcid: u32) -> ::windows::core::HRESULT; } VarFormatFromTokens(::core::mem::transmute(pvarin), pstrformat.into_param().abi(), ::core::mem::transmute(pbtokcur), ::core::mem::transmute(dwflags), ::core::mem::transmute(pbstrout), ::core::mem::transmute(lcid)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarFormatNumber(pvarin: *const super::Com::VARIANT, inumdig: i32, iinclead: i32, iuseparens: i32, igroup: i32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarFormatNumber(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, inumdig: i32, iinclead: i32, iuseparens: i32, igroup: i32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarFormatNumber(::core::mem::transmute(pvarin), ::core::mem::transmute(inumdig), ::core::mem::transmute(iinclead), ::core::mem::transmute(iuseparens), ::core::mem::transmute(igroup), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarFormatPercent(pvarin: *const super::Com::VARIANT, inumdig: i32, iinclead: i32, iuseparens: i32, igroup: i32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarFormatPercent(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, inumdig: i32, iinclead: i32, iuseparens: i32, igroup: i32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarFormatPercent(::core::mem::transmute(pvarin), ::core::mem::transmute(inumdig), ::core::mem::transmute(iinclead), ::core::mem::transmute(iuseparens), ::core::mem::transmute(igroup), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromBool(boolin: i16, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromBool(boolin: i16, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromBool(::core::mem::transmute(boolin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarI1FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromCy(cyin: super::Com::CY, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromCy(cyin.into_param().abi(), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromDate(datein: f64, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromDate(datein: f64, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromDate(::core::mem::transmute(datein), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromDec(pdecin: *const super::super::Foundation::DECIMAL, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromDec(pdecin: *const super::super::Foundation::DECIMAL, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromDec(::core::mem::transmute(pdecin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarI1FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromI2(uiin: i16, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromI2(uiin: i16, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromI2(::core::mem::transmute(uiin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromI4(lin: i32, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromI4(lin: i32, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromI4(::core::mem::transmute(lin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromI8(i64in: i64, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromI8(i64in: i64, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromI8(::core::mem::transmute(i64in), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromR4(fltin: f32, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromR4(fltin: f32, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromR4(::core::mem::transmute(fltin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromR8(dblin: f64, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromR8(dblin: f64, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromR8(::core::mem::transmute(dblin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromUI1(bin: u8, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromUI1(bin: u8, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromUI1(::core::mem::transmute(bin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromUI2(uiin: u16, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromUI2(uiin: u16, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromUI2(::core::mem::transmute(uiin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromUI4(ulin: u32, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromUI4(ulin: u32, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromUI4(::core::mem::transmute(ulin), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI1FromUI8(i64in: u64, pcout: super::super::Foundation::PSTR) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI1FromUI8(i64in: u64, pcout: super::super::Foundation::PSTR) -> ::windows::core::HRESULT; } VarI1FromUI8(::core::mem::transmute(i64in), ::core::mem::transmute(pcout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromBool(boolin: i16) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromBool(boolin: i16, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarI2FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0, psout: *mut i16) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromCy(cyin: super::Com::CY, psout: *mut i16) -> ::windows::core::HRESULT; } VarI2FromCy(cyin.into_param().abi(), ::core::mem::transmute(psout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromDate(datein: f64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromDate(datein: f64, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI2FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromDec(pdecin: *const super::super::Foundation::DECIMAL, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarI2FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI2FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromI1(cin: super::super::Foundation::CHAR, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromI1(cin.into_param().abi(), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromI4(lin: i32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromI4(lin: i32, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromI4(::core::mem::transmute(lin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromI8(i64in: i64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromI8(i64in: i64, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromR4(fltin: f32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromR4(fltin: f32, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromR8(dblin: f64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromR8(dblin: f64, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI2FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromUI1(bin: u8) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromUI1(bin: u8, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromUI2(uiin: u16) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromUI2(uiin: u16, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromUI4(ulin: u32) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromUI4(ulin: u32, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI2FromUI8(ui64in: u64) -> ::windows::core::Result<i16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI2FromUI8(ui64in: u64, psout: *mut i16) -> ::windows::core::HRESULT; } let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI2FromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<i16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromBool(boolin: i16) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromBool(boolin: i16, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarI4FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromCy(cyin: super::Com::CY, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromCy(cyin.into_param().abi(), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromDate(datein: f64) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromDate(datein: f64, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI4FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromDec(pdecin: *const super::super::Foundation::DECIMAL, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarI4FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI4FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromI1(cin: super::super::Foundation::CHAR, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromI1(cin.into_param().abi(), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromI2(sin: i16) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromI2(sin: i16, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromI2(::core::mem::transmute(sin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromI8(i64in: i64) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromI8(i64in: i64, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromR4(fltin: f32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromR4(fltin: f32, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromR8(dblin: f64) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromR8(dblin: f64, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI4FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromUI1(bin: u8) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromUI1(bin: u8, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromUI2(uiin: u16) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromUI2(uiin: u16, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromUI4(ulin: u32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromUI4(ulin: u32, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI4FromUI8(ui64in: u64) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI4FromUI8(ui64in: u64, plout: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI4FromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromBool(boolin: i16) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromBool(boolin: i16, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarI8FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromCy(cyin: super::Com::CY, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromCy(cyin.into_param().abi(), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromDate(datein: f64) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromDate(datein: f64, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI8FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromDec(pdecin: *const super::super::Foundation::DECIMAL, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarI8FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI8FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromI1(cin: super::super::Foundation::CHAR, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromI1(cin.into_param().abi(), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromI2(sin: i16) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromI2(sin: i16, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromI2(::core::mem::transmute(sin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromR4(fltin: f32) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromR4(fltin: f32, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromR8(dblin: f64) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromR8(dblin: f64, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarI8FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromUI1(bin: u8) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromUI1(bin: u8, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromUI2(uiin: u16) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromUI2(uiin: u16, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromUI4(ulin: u32) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromUI4(ulin: u32, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarI8FromUI8(ui64in: u64) -> ::windows::core::Result<i64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarI8FromUI8(ui64in: u64, pi64out: *mut i64) -> ::windows::core::HRESULT; } let mut result__: <i64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarI8FromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<i64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarIdiv(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarIdiv(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarIdiv(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarImp(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarImp(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarImp(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarInt(pvarin: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarInt(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarInt(::core::mem::transmute(pvarin), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarMod(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarMod(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarMod(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarMonthName(imonth: i32, fabbrev: i32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarMonthName(imonth: i32, fabbrev: i32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarMonthName(::core::mem::transmute(imonth), ::core::mem::transmute(fabbrev), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarMul(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarMul(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarMul(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarNeg(pvarin: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarNeg(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarNeg(::core::mem::transmute(pvarin), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarNot(pvarin: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarNot(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarNot(::core::mem::transmute(pvarin), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarNumFromParseNum(pnumprs: *const NUMPARSE, rgbdig: *const u8, dwvtbits: u32) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarNumFromParseNum(pnumprs: *const NUMPARSE, rgbdig: *const u8, dwvtbits: u32, pvar: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarNumFromParseNum(::core::mem::transmute(pnumprs), ::core::mem::transmute(rgbdig), ::core::mem::transmute(dwvtbits), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarOr(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarOr(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarOr(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarParseNumFromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32, pnumprs: *mut NUMPARSE, rgbdig: *mut u8) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarParseNumFromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pnumprs: *mut NUMPARSE, rgbdig: *mut u8) -> ::windows::core::HRESULT; } VarParseNumFromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), ::core::mem::transmute(pnumprs), ::core::mem::transmute(rgbdig)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarPow(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarPow(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarPow(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4CmpR8(fltleft: f32, dblright: f64) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4CmpR8(fltleft: f32, dblright: f64) -> ::windows::core::HRESULT; } VarR4CmpR8(::core::mem::transmute(fltleft), ::core::mem::transmute(dblright)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromBool(boolin: i16) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromBool(boolin: i16, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarR4FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0, pfltout: *mut f32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromCy(cyin: super::Com::CY, pfltout: *mut f32) -> ::windows::core::HRESULT; } VarR4FromCy(cyin.into_param().abi(), ::core::mem::transmute(pfltout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromDate(datein: f64) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromDate(datein: f64, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarR4FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromDec(pdecin: *const super::super::Foundation::DECIMAL, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarR4FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarR4FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromI1(cin: super::super::Foundation::CHAR, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromI1(cin.into_param().abi(), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromI2(sin: i16) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromI2(sin: i16, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromI2(::core::mem::transmute(sin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromI4(lin: i32) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromI4(lin: i32, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromI4(::core::mem::transmute(lin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromI8(i64in: i64) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromI8(i64in: i64, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromR8(dblin: f64) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromR8(dblin: f64, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarR4FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromUI1(bin: u8) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromUI1(bin: u8, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromUI2(uiin: u16) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromUI2(uiin: u16, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromUI4(ulin: u32) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromUI4(ulin: u32, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR4FromUI8(ui64in: u64) -> ::windows::core::Result<f32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR4FromUI8(ui64in: u64, pfltout: *mut f32) -> ::windows::core::HRESULT; } let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR4FromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<f32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromBool(boolin: i16) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromBool(boolin: i16, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarR8FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0, pdblout: *mut f64) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromCy(cyin: super::Com::CY, pdblout: *mut f64) -> ::windows::core::HRESULT; } VarR8FromCy(cyin.into_param().abi(), ::core::mem::transmute(pdblout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromDate(datein: f64) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromDate(datein: f64, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarR8FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromDec(pdecin: *const super::super::Foundation::DECIMAL, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarR8FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarR8FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0, pdblout: *mut f64) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromI1(cin: super::super::Foundation::CHAR, pdblout: *mut f64) -> ::windows::core::HRESULT; } VarR8FromI1(cin.into_param().abi(), ::core::mem::transmute(pdblout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromI2(sin: i16) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromI2(sin: i16, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromI2(::core::mem::transmute(sin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromI4(lin: i32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromI4(lin: i32, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromI4(::core::mem::transmute(lin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromI8(i64in: i64) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromI8(i64in: i64, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromR4(fltin: f32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromR4(fltin: f32, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarR8FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromUI1(bin: u8) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromUI1(bin: u8, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromUI2(uiin: u16) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromUI2(uiin: u16, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromUI4(ulin: u32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromUI4(ulin: u32, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8FromUI8(ui64in: u64) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8FromUI8(ui64in: u64, pdblout: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8FromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8Pow(dblleft: f64, dblright: f64) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8Pow(dblleft: f64, dblright: f64, pdblresult: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8Pow(::core::mem::transmute(dblleft), ::core::mem::transmute(dblright), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarR8Round(dblin: f64, cdecimals: i32) -> ::windows::core::Result<f64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarR8Round(dblin: f64, cdecimals: i32, pdblresult: *mut f64) -> ::windows::core::HRESULT; } let mut result__: <f64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarR8Round(::core::mem::transmute(dblin), ::core::mem::transmute(cdecimals), &mut result__).from_abi::<f64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarRound(pvarin: *const super::Com::VARIANT, cdecimals: i32) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarRound(pvarin: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, cdecimals: i32, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarRound(::core::mem::transmute(pvarin), ::core::mem::transmute(cdecimals), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarSub(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarSub(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarSub(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarTokenizeFormatString<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(pstrformat: Param0, rgbtok: *mut u8, cbtok: i32, ifirstday: i32, ifirstweek: i32, lcid: u32, pcbactual: *const i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarTokenizeFormatString(pstrformat: super::super::Foundation::PWSTR, rgbtok: *mut u8, cbtok: i32, ifirstday: i32, ifirstweek: i32, lcid: u32, pcbactual: *const i32) -> ::windows::core::HRESULT; } VarTokenizeFormatString(pstrformat.into_param().abi(), ::core::mem::transmute(rgbtok), ::core::mem::transmute(cbtok), ::core::mem::transmute(ifirstday), ::core::mem::transmute(ifirstweek), ::core::mem::transmute(lcid), ::core::mem::transmute(pcbactual)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromBool(boolin: i16) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromBool(boolin: i16, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI1FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromCy(cyin: super::Com::CY, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromCy(cyin.into_param().abi(), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromDate(datein: f64) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromDate(datein: f64, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI1FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromDec(pdecin: *const super::super::Foundation::DECIMAL, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI1FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI1FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromI1(cin: super::super::Foundation::CHAR, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromI1(cin.into_param().abi(), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromI2(sin: i16) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromI2(sin: i16, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromI2(::core::mem::transmute(sin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromI4(lin: i32) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromI4(lin: i32, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromI4(::core::mem::transmute(lin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromI8(i64in: i64) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromI8(i64in: i64, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromR4(fltin: f32) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromR4(fltin: f32, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromR8(dblin: f64) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromR8(dblin: f64, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI1FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromUI2(uiin: u16) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromUI2(uiin: u16, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromUI4(ulin: u32) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromUI4(ulin: u32, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI1FromUI8(ui64in: u64) -> ::windows::core::Result<u8> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI1FromUI8(ui64in: u64, pbout: *mut u8) -> ::windows::core::HRESULT; } let mut result__: <u8 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI1FromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<u8>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromBool(boolin: i16) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromBool(boolin: i16, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI2FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromCy(cyin: super::Com::CY, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromCy(cyin.into_param().abi(), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromDate(datein: f64) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromDate(datein: f64, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI2FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromDec(pdecin: *const super::super::Foundation::DECIMAL, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI2FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI2FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromI1(cin: super::super::Foundation::CHAR, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromI1(cin.into_param().abi(), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromI2(uiin: i16) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromI2(uiin: i16, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromI2(::core::mem::transmute(uiin), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromI4(lin: i32) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromI4(lin: i32, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromI4(::core::mem::transmute(lin), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromI8(i64in: i64) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromI8(i64in: i64, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromR4(fltin: f32) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromR4(fltin: f32, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromR8(dblin: f64, puiout: *mut u16) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromR8(dblin: f64, puiout: *mut u16) -> ::windows::core::HRESULT; } VarUI2FromR8(::core::mem::transmute(dblin), ::core::mem::transmute(puiout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI2FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromUI1(bin: u8) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromUI1(bin: u8, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromUI4(ulin: u32) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromUI4(ulin: u32, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI2FromUI8(i64in: u64) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI2FromUI8(i64in: u64, puiout: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI2FromUI8(::core::mem::transmute(i64in), &mut result__).from_abi::<u16>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromBool(boolin: i16) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromBool(boolin: i16, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI4FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromCy(cyin: super::Com::CY, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromCy(cyin.into_param().abi(), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromDate(datein: f64) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromDate(datein: f64, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI4FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromDec(pdecin: *const super::super::Foundation::DECIMAL, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI4FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI4FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromI1(cin: super::super::Foundation::CHAR, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromI1(cin.into_param().abi(), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromI2(uiin: i16) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromI2(uiin: i16, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromI2(::core::mem::transmute(uiin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromI4(lin: i32) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromI4(lin: i32, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromI4(::core::mem::transmute(lin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromI8(i64in: i64) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromI8(i64in: i64, plout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromI8(::core::mem::transmute(i64in), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromR4(fltin: f32) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromR4(fltin: f32, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromR8(dblin: f64) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromR8(dblin: f64, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI4FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromUI1(bin: u8) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromUI1(bin: u8, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromUI2(uiin: u16) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromUI2(uiin: u16, pulout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI4FromUI8(ui64in: u64) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI4FromUI8(ui64in: u64, plout: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI4FromUI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromBool(boolin: i16) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromBool(boolin: i16, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromBool(::core::mem::transmute(boolin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI8FromCy<'a, Param0: ::windows::core::IntoParam<'a, super::Com::CY>>(cyin: Param0) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromCy(cyin: super::Com::CY, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromCy(cyin.into_param().abi(), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromDate(datein: f64) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromDate(datein: f64, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromDate(::core::mem::transmute(datein), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI8FromDec(pdecin: *const super::super::Foundation::DECIMAL) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromDec(pdecin: *const super::super::Foundation::DECIMAL, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromDec(::core::mem::transmute(pdecin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn VarUI8FromDisp<'a, Param0: ::windows::core::IntoParam<'a, super::Com::IDispatch>>(pdispin: Param0, lcid: u32) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromDisp(pdispin: ::windows::core::RawPtr, lcid: u32, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromDisp(pdispin.into_param().abi(), ::core::mem::transmute(lcid), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI8FromI1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::CHAR>>(cin: Param0) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromI1(cin: super::super::Foundation::CHAR, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromI1(cin.into_param().abi(), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromI2(sin: i16) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromI2(sin: i16, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromI2(::core::mem::transmute(sin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromI8(ui64in: i64) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromI8(ui64in: i64, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromI8(::core::mem::transmute(ui64in), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromR4(fltin: f32) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromR4(fltin: f32, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromR4(::core::mem::transmute(fltin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromR8(dblin: f64) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromR8(dblin: f64, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromR8(::core::mem::transmute(dblin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUI8FromStr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(strin: Param0, lcid: u32, dwflags: u32) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromStr(strin: super::super::Foundation::PWSTR, lcid: u32, dwflags: u32, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromStr(strin.into_param().abi(), ::core::mem::transmute(lcid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromUI1(bin: u8) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromUI1(bin: u8, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromUI1(::core::mem::transmute(bin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromUI2(uiin: u16) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromUI2(uiin: u16, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromUI2(::core::mem::transmute(uiin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VarUI8FromUI4(ulin: u32) -> ::windows::core::Result<u64> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUI8FromUI4(ulin: u32, pi64out: *mut u64) -> ::windows::core::HRESULT; } let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUI8FromUI4(::core::mem::transmute(ulin), &mut result__).from_abi::<u64>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarUdateFromDate(datein: f64, dwflags: u32) -> ::windows::core::Result<UDATE> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarUdateFromDate(datein: f64, dwflags: u32, pudateout: *mut UDATE) -> ::windows::core::HRESULT; } let mut result__: <UDATE as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarUdateFromDate(::core::mem::transmute(datein), ::core::mem::transmute(dwflags), &mut result__).from_abi::<UDATE>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VarWeekdayName(iweekday: i32, fabbrev: i32, ifirstday: i32, dwflags: u32) -> ::windows::core::Result<super::super::Foundation::BSTR> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarWeekdayName(iweekday: i32, fabbrev: i32, ifirstday: i32, dwflags: u32, pbstrout: *mut ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarWeekdayName(::core::mem::transmute(iweekday), ::core::mem::transmute(fabbrev), ::core::mem::transmute(ifirstday), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Foundation::BSTR>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VarXor(pvarleft: *const super::Com::VARIANT, pvarright: *const super::Com::VARIANT) -> ::windows::core::Result<super::Com::VARIANT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VarXor(pvarleft: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarright: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarresult: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } let mut result__: <super::Com::VARIANT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VarXor(::core::mem::transmute(pvarleft), ::core::mem::transmute(pvarright), &mut result__).from_abi::<super::Com::VARIANT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VariantChangeType(pvargdest: *mut super::Com::VARIANT, pvarsrc: *const super::Com::VARIANT, wflags: u16, vt: u16) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantChangeType(pvargdest: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarsrc: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, wflags: u16, vt: u16) -> ::windows::core::HRESULT; } VariantChangeType(::core::mem::transmute(pvargdest), ::core::mem::transmute(pvarsrc), ::core::mem::transmute(wflags), ::core::mem::transmute(vt)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VariantChangeTypeEx(pvargdest: *mut super::Com::VARIANT, pvarsrc: *const super::Com::VARIANT, lcid: u32, wflags: u16, vt: u16) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantChangeTypeEx(pvargdest: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvarsrc: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>, lcid: u32, wflags: u16, vt: u16) -> ::windows::core::HRESULT; } VariantChangeTypeEx(::core::mem::transmute(pvargdest), ::core::mem::transmute(pvarsrc), ::core::mem::transmute(lcid), ::core::mem::transmute(wflags), ::core::mem::transmute(vt)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VariantClear(pvarg: *mut super::Com::VARIANT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantClear(pvarg: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } VariantClear(::core::mem::transmute(pvarg)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VariantCopy(pvargdest: *mut super::Com::VARIANT, pvargsrc: *const super::Com::VARIANT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantCopy(pvargdest: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvargsrc: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } VariantCopy(::core::mem::transmute(pvargdest), ::core::mem::transmute(pvargsrc)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VariantCopyInd(pvardest: *mut super::Com::VARIANT, pvargsrc: *const super::Com::VARIANT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantCopyInd(pvardest: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>, pvargsrc: *const ::core::mem::ManuallyDrop<super::Com::VARIANT>) -> ::windows::core::HRESULT; } VariantCopyInd(::core::mem::transmute(pvardest), ::core::mem::transmute(pvargsrc)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VariantInit(pvarg: *mut super::Com::VARIANT) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantInit(pvarg: *mut ::core::mem::ManuallyDrop<super::Com::VARIANT>); } ::core::mem::transmute(VariantInit(::core::mem::transmute(pvarg))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn VariantTimeToDosDateTime(vtime: f64, pwdosdate: *mut u16, pwdostime: *mut u16) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantTimeToDosDateTime(vtime: f64, pwdosdate: *mut u16, pwdostime: *mut u16) -> i32; } ::core::mem::transmute(VariantTimeToDosDateTime(::core::mem::transmute(vtime), ::core::mem::transmute(pwdosdate), ::core::mem::transmute(pwdostime))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn VariantTimeToSystemTime(vtime: f64, lpsystemtime: *mut super::super::Foundation::SYSTEMTIME) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VariantTimeToSystemTime(vtime: f64, lpsystemtime: *mut super::super::Foundation::SYSTEMTIME) -> i32; } ::core::mem::transmute(VariantTimeToSystemTime(::core::mem::transmute(vtime), ::core::mem::transmute(lpsystemtime))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn VectorFromBstr<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BSTR>>(bstr: Param0) -> ::windows::core::Result<*mut super::Com::SAFEARRAY> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn VectorFromBstr(bstr: ::core::mem::ManuallyDrop<super::super::Foundation::BSTR>, ppsa: *mut *mut super::Com::SAFEARRAY) -> ::windows::core::HRESULT; } let mut result__: <*mut super::Com::SAFEARRAY as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); VectorFromBstr(bstr.into_param().abi(), &mut result__).from_abi::<*mut super::Com::SAFEARRAY>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const WIN32: u32 = 100u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct WPCSETTING(pub i32); pub const WPCSETTING_LOGGING_ENABLED: WPCSETTING = WPCSETTING(1i32); pub const WPCSETTING_FILEDOWNLOAD_BLOCKED: WPCSETTING = WPCSETTING(2i32); impl ::core::convert::From<i32> for WPCSETTING { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for WPCSETTING { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct XFORMCOORDS(pub i32); pub const XFORMCOORDS_POSITION: XFORMCOORDS = XFORMCOORDS(1i32); pub const XFORMCOORDS_SIZE: XFORMCOORDS = XFORMCOORDS(2i32); pub const XFORMCOORDS_HIMETRICTOCONTAINER: XFORMCOORDS = XFORMCOORDS(4i32); pub const XFORMCOORDS_CONTAINERTOHIMETRIC: XFORMCOORDS = XFORMCOORDS(8i32); pub const XFORMCOORDS_EVENTCOMPAT: XFORMCOORDS = XFORMCOORDS(16i32); impl ::core::convert::From<i32> for XFORMCOORDS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for XFORMCOORDS { type Abi = Self; } #[derive(:: core :: clone :: Clone)] #[repr(C)] pub struct _wireBRECORD { pub fFlags: u32, pub clSize: u32, pub pRecInfo: ::core::option::Option<IRecordInfo>, pub pRecord: *mut u8, } impl _wireBRECORD {} impl ::core::default::Default for _wireBRECORD { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for _wireBRECORD { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wireBRECORD").field("fFlags", &self.fFlags).field("clSize", &self.clSize).field("pRecInfo", &self.pRecInfo).field("pRecord", &self.pRecord).finish() } } impl ::core::cmp::PartialEq for _wireBRECORD { fn eq(&self, other: &Self) -> bool { self.fFlags == other.fFlags && self.clSize == other.clSize && self.pRecInfo == other.pRecInfo && self.pRecord == other.pRecord } } impl ::core::cmp::Eq for _wireBRECORD {} unsafe impl ::windows::core::Abi for _wireBRECORD { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct _wireSAFEARRAY { pub cDims: u16, pub fFeatures: u16, pub cbElements: u32, pub cLocks: u32, pub uArrayStructs: _wireSAFEARRAY_UNION, pub rgsabound: [super::Com::SAFEARRAYBOUND; 1], } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl _wireSAFEARRAY {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for _wireSAFEARRAY { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for _wireSAFEARRAY { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for _wireSAFEARRAY {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for _wireSAFEARRAY { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct _wireSAFEARRAY_UNION { pub sfType: u32, pub u: _wireSAFEARRAY_UNION_0, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl _wireSAFEARRAY_UNION {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for _wireSAFEARRAY_UNION { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for _wireSAFEARRAY_UNION { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for _wireSAFEARRAY_UNION {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for _wireSAFEARRAY_UNION { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub union _wireSAFEARRAY_UNION_0 { pub BstrStr: _wireSAFEARR_BSTR, pub UnknownStr: _wireSAFEARR_UNKNOWN, pub DispatchStr: _wireSAFEARR_DISPATCH, pub VariantStr: _wireSAFEARR_VARIANT, pub RecordStr: _wireSAFEARR_BRECORD, pub HaveIidStr: _wireSAFEARR_HAVEIID, pub ByteStr: super::Com::BYTE_SIZEDARR, pub WordStr: super::Com::SHORT_SIZEDARR, pub LongStr: super::Com::LONG_SIZEDARR, pub HyperStr: super::Com::HYPER_SIZEDARR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl _wireSAFEARRAY_UNION_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for _wireSAFEARRAY_UNION_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for _wireSAFEARRAY_UNION_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for _wireSAFEARRAY_UNION_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for _wireSAFEARRAY_UNION_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct _wireSAFEARR_BRECORD { pub Size: u32, pub aRecord: *mut *mut _wireBRECORD, } impl _wireSAFEARR_BRECORD {} impl ::core::default::Default for _wireSAFEARR_BRECORD { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for _wireSAFEARR_BRECORD { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wireSAFEARR_BRECORD").field("Size", &self.Size).field("aRecord", &self.aRecord).finish() } } impl ::core::cmp::PartialEq for _wireSAFEARR_BRECORD { fn eq(&self, other: &Self) -> bool { self.Size == other.Size && self.aRecord == other.aRecord } } impl ::core::cmp::Eq for _wireSAFEARR_BRECORD {} unsafe impl ::windows::core::Abi for _wireSAFEARR_BRECORD { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_System_Com")] pub struct _wireSAFEARR_BSTR { pub Size: u32, pub aBstr: *mut *mut super::Com::FLAGGED_WORD_BLOB, } #[cfg(feature = "Win32_System_Com")] impl _wireSAFEARR_BSTR {} #[cfg(feature = "Win32_System_Com")] impl ::core::default::Default for _wireSAFEARR_BSTR { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_System_Com")] impl ::core::fmt::Debug for _wireSAFEARR_BSTR { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wireSAFEARR_BSTR").field("Size", &self.Size).field("aBstr", &self.aBstr).finish() } } #[cfg(feature = "Win32_System_Com")] impl ::core::cmp::PartialEq for _wireSAFEARR_BSTR { fn eq(&self, other: &Self) -> bool { self.Size == other.Size && self.aBstr == other.aBstr } } #[cfg(feature = "Win32_System_Com")] impl ::core::cmp::Eq for _wireSAFEARR_BSTR {} #[cfg(feature = "Win32_System_Com")] unsafe impl ::windows::core::Abi for _wireSAFEARR_BSTR { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_System_Com")] pub struct _wireSAFEARR_DISPATCH { pub Size: u32, pub apDispatch: *mut ::core::option::Option<super::Com::IDispatch>, } #[cfg(feature = "Win32_System_Com")] impl _wireSAFEARR_DISPATCH {} #[cfg(feature = "Win32_System_Com")] impl ::core::default::Default for _wireSAFEARR_DISPATCH { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_System_Com")] impl ::core::fmt::Debug for _wireSAFEARR_DISPATCH { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wireSAFEARR_DISPATCH").field("Size", &self.Size).field("apDispatch", &self.apDispatch).finish() } } #[cfg(feature = "Win32_System_Com")] impl ::core::cmp::PartialEq for _wireSAFEARR_DISPATCH { fn eq(&self, other: &Self) -> bool { self.Size == other.Size && self.apDispatch == other.apDispatch } } #[cfg(feature = "Win32_System_Com")] impl ::core::cmp::Eq for _wireSAFEARR_DISPATCH {} #[cfg(feature = "Win32_System_Com")] unsafe impl ::windows::core::Abi for _wireSAFEARR_DISPATCH { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct _wireSAFEARR_HAVEIID { pub Size: u32, pub apUnknown: *mut ::core::option::Option<::windows::core::IUnknown>, pub iid: ::windows::core::GUID, } impl _wireSAFEARR_HAVEIID {} impl ::core::default::Default for _wireSAFEARR_HAVEIID { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for _wireSAFEARR_HAVEIID { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wireSAFEARR_HAVEIID").field("Size", &self.Size).field("apUnknown", &self.apUnknown).field("iid", &self.iid).finish() } } impl ::core::cmp::PartialEq for _wireSAFEARR_HAVEIID { fn eq(&self, other: &Self) -> bool { self.Size == other.Size && self.apUnknown == other.apUnknown && self.iid == other.iid } } impl ::core::cmp::Eq for _wireSAFEARR_HAVEIID {} unsafe impl ::windows::core::Abi for _wireSAFEARR_HAVEIID { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct _wireSAFEARR_UNKNOWN { pub Size: u32, pub apUnknown: *mut ::core::option::Option<::windows::core::IUnknown>, } impl _wireSAFEARR_UNKNOWN {} impl ::core::default::Default for _wireSAFEARR_UNKNOWN { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for _wireSAFEARR_UNKNOWN { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wireSAFEARR_UNKNOWN").field("Size", &self.Size).field("apUnknown", &self.apUnknown).finish() } } impl ::core::cmp::PartialEq for _wireSAFEARR_UNKNOWN { fn eq(&self, other: &Self) -> bool { self.Size == other.Size && self.apUnknown == other.apUnknown } } impl ::core::cmp::Eq for _wireSAFEARR_UNKNOWN {} unsafe impl ::windows::core::Abi for _wireSAFEARR_UNKNOWN { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct _wireSAFEARR_VARIANT { pub Size: u32, pub aVariant: *mut *mut _wireVARIANT, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl _wireSAFEARR_VARIANT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for _wireSAFEARR_VARIANT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::fmt::Debug for _wireSAFEARR_VARIANT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("_wireSAFEARR_VARIANT").field("Size", &self.Size).field("aVariant", &self.aVariant).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for _wireSAFEARR_VARIANT { fn eq(&self, other: &Self) -> bool { self.Size == other.Size && self.aVariant == other.aVariant } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for _wireSAFEARR_VARIANT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for _wireSAFEARR_VARIANT { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::clone::Clone for _wireVARIANT { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub struct _wireVARIANT { pub clSize: u32, pub rpcReserved: u32, pub vt: u16, pub wReserved1: u16, pub wReserved2: u16, pub wReserved3: u16, pub Anonymous: _wireVARIANT_0, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl _wireVARIANT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for _wireVARIANT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for _wireVARIANT { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for _wireVARIANT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for _wireVARIANT { type Abi = ::core::mem::ManuallyDrop<Self>; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::clone::Clone for _wireVARIANT_0 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub union _wireVARIANT_0 { pub llVal: i64, pub lVal: i32, pub bVal: u8, pub iVal: i16, pub fltVal: f32, pub dblVal: f64, pub boolVal: i16, pub scode: i32, pub cyVal: super::Com::CY, pub date: f64, pub bstrVal: *mut super::Com::FLAGGED_WORD_BLOB, pub punkVal: ::windows::core::RawPtr, pub pdispVal: ::windows::core::RawPtr, pub parray: *mut *mut _wireSAFEARRAY, pub brecVal: *mut ::core::mem::ManuallyDrop<_wireBRECORD>, pub pbVal: *mut u8, pub piVal: *mut i16, pub plVal: *mut i32, pub pllVal: *mut i64, pub pfltVal: *mut f32, pub pdblVal: *mut f64, pub pboolVal: *mut i16, pub pscode: *mut i32, pub pcyVal: *mut super::Com::CY, pub pdate: *mut f64, pub pbstrVal: *mut *mut super::Com::FLAGGED_WORD_BLOB, pub ppunkVal: *mut ::windows::core::RawPtr, pub ppdispVal: *mut ::windows::core::RawPtr, pub pparray: *mut *mut *mut _wireSAFEARRAY, pub pvarVal: *mut *mut ::core::mem::ManuallyDrop<_wireVARIANT>, pub cVal: super::super::Foundation::CHAR, pub uiVal: u16, pub ulVal: u32, pub ullVal: u64, pub intVal: i32, pub uintVal: u32, pub decVal: super::super::Foundation::DECIMAL, pub pdecVal: *mut super::super::Foundation::DECIMAL, pub pcVal: super::super::Foundation::PSTR, pub puiVal: *mut u16, pub pulVal: *mut u32, pub pullVal: *mut u64, pub pintVal: *mut i32, pub puintVal: *mut u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl _wireVARIANT_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::default::Default for _wireVARIANT_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::PartialEq for _wireVARIANT_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::cmp::Eq for _wireVARIANT_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] unsafe impl ::windows::core::Abi for _wireVARIANT_0 { type Abi = ::core::mem::ManuallyDrop<Self>; }
pub mod shader_compilation; pub mod vao; pub mod vbo; pub mod ebo; pub mod texture_2d; pub mod texture_cube_map; pub mod fbo; pub mod rbo; pub mod ubo; pub use shader_compilation::*; pub use vao::*; pub use vbo::*; pub use ebo::*; pub use texture_2d::*; pub use texture_cube_map::*; pub use fbo::*; pub use rbo::*; pub use ubo::*; use std::ffi::c_void; pub const NULLPTR: *mut c_void = 0 as *mut c_void; pub enum BufferUpdateFrequency { Never, Occasionally, Often, } impl BufferUpdateFrequency { pub fn to_gl_enum(&self) -> u32 { match self { BufferUpdateFrequency::Never => gl::STATIC_DRAW, BufferUpdateFrequency::Occasionally => gl::DYNAMIC_DRAW, BufferUpdateFrequency::Often => gl::STREAM_DRAW, } } }
#![feature(llvm_asm)] fn main() { let x = (); unsafe { let p: *const () = &x; llvm_asm!("" :: "r"(*p)); } }
use std::borrow::Cow; use std::ops::{Bound, RangeBounds}; use std::{mem, ptr}; use crate::mdb::error::mdb_result; use crate::mdb::ffi; use crate::types::DecodeIgnore; use crate::*; /// A polymorphic database that accepts types on call methods and not at creation. /// /// # Example: Iterate over ranges of databases entries /// /// In this example we store numbers in big endian this way those are ordered. /// Thanks to their bytes representation, heed is able to iterate over them /// from the lowest to the highest. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::PolyDatabase; /// use heed::types::*; /// use heed::{zerocopy::I64, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI64 = I64<BigEndian>; /// /// let db: PolyDatabase = env.create_poly_database(Some("big-endian-iter"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI64>, Unit>(&mut wtxn, &BEI64::new(0), &())?; /// db.put::<_, OwnedType<BEI64>, Str>(&mut wtxn, &BEI64::new(35), "thirty five")?; /// db.put::<_, OwnedType<BEI64>, Str>(&mut wtxn, &BEI64::new(42), "forty two")?; /// db.put::<_, OwnedType<BEI64>, Unit>(&mut wtxn, &BEI64::new(68), &())?; /// /// // you can iterate over database entries in order /// let range = BEI64::new(35)..=BEI64::new(42); /// let mut range = db.range::<_, OwnedType<BEI64>, Str, _>(&wtxn, &range)?; /// assert_eq!(range.next().transpose()?, Some((BEI64::new(35), "thirty five"))); /// assert_eq!(range.next().transpose()?, Some((BEI64::new(42), "forty two"))); /// assert_eq!(range.next().transpose()?, None); /// /// drop(range); /// wtxn.commit()?; /// # Ok(()) } /// ``` /// /// # Example: Select ranges of entries /// /// Heed also support ranges deletions. /// Same configuration as above, numbers are ordered, therefore it is safe to specify /// a range and be able to iterate over and/or delete it. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::PolyDatabase; /// use heed::types::*; /// use heed::{zerocopy::I64, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI64 = I64<BigEndian>; /// /// let db: PolyDatabase = env.create_poly_database(Some("big-endian-iter"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI64>, Unit>(&mut wtxn, &BEI64::new(0), &())?; /// db.put::<_, OwnedType<BEI64>, Str>(&mut wtxn, &BEI64::new(35), "thirty five")?; /// db.put::<_, OwnedType<BEI64>, Str>(&mut wtxn, &BEI64::new(42), "forty two")?; /// db.put::<_, OwnedType<BEI64>, Unit>(&mut wtxn, &BEI64::new(68), &())?; /// /// // even delete a range of keys /// let range = BEI64::new(35)..=BEI64::new(42); /// let deleted = db.delete_range::<_, OwnedType<BEI64>, _>(&mut wtxn, &range)?; /// assert_eq!(deleted, 2); /// /// let rets: Result<_, _> = db.iter::<_, OwnedType<BEI64>, Unit>(&wtxn)?.collect(); /// let rets: Vec<(BEI64, _)> = rets?; /// /// let expected = vec![ /// (BEI64::new(0), ()), /// (BEI64::new(68), ()), /// ]; /// /// assert_eq!(deleted, 2); /// assert_eq!(rets, expected); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` #[derive(Copy, Clone)] pub struct PolyDatabase { pub(crate) env_ident: usize, pub(crate) dbi: ffi::MDB_dbi, } impl PolyDatabase { pub(crate) fn new(env_ident: usize, dbi: ffi::MDB_dbi) -> PolyDatabase { PolyDatabase { env_ident, dbi } } /// Retrieve the sequence of a database. /// /// This function allows to retrieve the unique positive integer of this database. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// let db = env.create_poly_database(Some("use-sequence-1"))?; /// /// // The sequence starts at zero /// let rtxn = env.read_txn()?; /// let ret = db.sequence(&rtxn)?; /// assert_eq!(ret, 0); /// rtxn.abort()?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// let incr = db.increase_sequence(&mut wtxn, 32)?; /// assert_eq!(incr, Some(0)); /// let incr = db.increase_sequence(&mut wtxn, 28)?; /// assert_eq!(incr, Some(32)); /// wtxn.commit()?; /// /// let rtxn = env.read_txn()?; /// let ret = db.sequence(&rtxn)?; /// assert_eq!(ret, 60); /// /// # Ok(()) } /// ``` #[cfg(all(feature = "mdbx", not(feature = "lmdb")))] pub fn sequence<T>(&self, txn: &RoTxn<T>) -> Result<u64> { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut value = mem::MaybeUninit::uninit(); let result = unsafe { mdb_result(ffi::mdbx_dbi_sequence( txn.txn, self.dbi, value.as_mut_ptr(), 0, // increment must be 0 for read-only transactions )) }; match result { Ok(()) => unsafe { Ok(value.assume_init()) }, Err(e) => Err(e.into()), } } /// Increment the sequence of a database. /// /// This function allows to create a linear sequence of a unique positive integer /// for this database. Sequence changes become visible outside the current write /// transaction after it is committed, and discarded on abort. /// /// Returns `Some` with the previous value and `None` if increasing the value /// resulted in an overflow an therefore cannot be executed. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// let db = env.create_poly_database(Some("use-sequence-2"))?; /// /// let mut wtxn = env.write_txn()?; /// let incr = db.increase_sequence(&mut wtxn, 32)?; /// assert_eq!(incr, Some(0)); /// let incr = db.increase_sequence(&mut wtxn, 28)?; /// assert_eq!(incr, Some(32)); /// wtxn.commit()?; /// /// let rtxn = env.read_txn()?; /// let ret = db.sequence(&rtxn)?; /// assert_eq!(ret, 60); /// /// # Ok(()) } /// ``` #[cfg(all(feature = "mdbx", not(feature = "lmdb")))] pub fn increase_sequence<T>(&self, txn: &mut RwTxn<T>, increment: u64) -> Result<Option<u64>> { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); use crate::mdb::error::Error; let mut value = mem::MaybeUninit::uninit(); let result = unsafe { mdb_result(ffi::mdbx_dbi_sequence( txn.txn.txn, self.dbi, value.as_mut_ptr(), increment, )) }; match result { Ok(()) => unsafe { Ok(Some(value.assume_init())) }, Err(Error::Other(c)) if c == i32::max_value() => Ok(None), // MDBX_RESULT_TRUE Err(e) => Err(e.into()), } } /// Retrieves the value associated with a key. /// /// If the key does not exist, then `None` is returned. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// let db = env.create_poly_database(Some("get-poly-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, Str, OwnedType<i32>>(&mut wtxn, "i-am-forty-two", &42)?; /// db.put::<_, Str, OwnedType<i32>>(&mut wtxn, "i-am-twenty-seven", &27)?; /// /// let ret = db.get::<_, Str, OwnedType<i32>>(&wtxn, "i-am-forty-two")?; /// assert_eq!(ret, Some(42)); /// /// let ret = db.get::<_, Str, OwnedType<i32>>(&wtxn, "i-am-twenty-one")?; /// assert_eq!(ret, None); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn get<'a, 'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, key: &'a KC::EItem, ) -> Result<Option<DC::DItem>> where KC: BytesEncode<'a>, DC: BytesDecode<'txn>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; let mut key_val = unsafe { crate::into_val(&key_bytes) }; let mut data_val = mem::MaybeUninit::uninit(); let result = unsafe { mdb_result(ffi::mdb_get( txn.txn, self.dbi, &mut key_val, data_val.as_mut_ptr(), )) }; match result { Ok(()) => { let data = unsafe { crate::from_val(data_val.assume_init()) }; let data = DC::bytes_decode(data).ok_or(Error::Decoding)?; Ok(Some(data)) } Err(e) if e.not_found() => Ok(None), Err(e) => Err(e.into()), } } /// Retrieves the key/value pair lower than the given one in this database. /// /// If the database if empty or there is no key lower than the given one, /// then `None` is returned. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::U32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEU32 = U32<BigEndian>; /// /// let db = env.create_poly_database(Some("get-lt-u32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(27), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(42), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(43), &())?; /// /// let ret = db.get_lower_than::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(4404))?; /// assert_eq!(ret, Some((BEU32::new(43), ()))); /// /// let ret = db.get_lower_than::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(43))?; /// assert_eq!(ret, Some((BEU32::new(42), ()))); /// /// let ret = db.get_lower_than::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(27))?; /// assert_eq!(ret, None); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn get_lower_than<'a, 'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, key: &'a KC::EItem, ) -> Result<Option<(KC::DItem, DC::DItem)>> where KC: BytesEncode<'a> + BytesDecode<'txn>, DC: BytesDecode<'txn>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; cursor.move_on_key_greater_than_or_equal_to(&key_bytes)?; match cursor.move_on_prev() { Ok(Some((key, data))) => match (KC::bytes_decode(key), DC::bytes_decode(data)) { (Some(key), Some(data)) => Ok(Some((key, data))), (_, _) => Err(Error::Decoding), }, Ok(None) => Ok(None), Err(e) => Err(e), } } /// Retrieves the key/value pair lower than or equal the given one in this database. /// /// If the database if empty or there is no key lower than or equal to the given one, /// then `None` is returned. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::U32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEU32 = U32<BigEndian>; /// /// let db = env.create_poly_database(Some("get-lte-u32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(27), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(42), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(43), &())?; /// /// let ret = db.get_lower_than_or_equal_to::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(4404))?; /// assert_eq!(ret, Some((BEU32::new(43), ()))); /// /// let ret = db.get_lower_than_or_equal_to::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(43))?; /// assert_eq!(ret, Some((BEU32::new(43), ()))); /// /// let ret = db.get_lower_than_or_equal_to::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(26))?; /// assert_eq!(ret, None); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn get_lower_than_or_equal_to<'a, 'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, key: &'a KC::EItem, ) -> Result<Option<(KC::DItem, DC::DItem)>> where KC: BytesEncode<'a> + BytesDecode<'txn>, DC: BytesDecode<'txn>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; let result = match cursor.move_on_key_greater_than_or_equal_to(&key_bytes) { Ok(Some((key, data))) if key == &key_bytes[..] => Ok(Some((key, data))), Ok(_) => cursor.move_on_prev(), Err(e) => Err(e), }; match result { Ok(Some((key, data))) => match (KC::bytes_decode(key), DC::bytes_decode(data)) { (Some(key), Some(data)) => Ok(Some((key, data))), (_, _) => Err(Error::Decoding), }, Ok(None) => Ok(None), Err(e) => Err(e), } } /// Retrieves the key/value pair greater than the given one in this database. /// /// If the database if empty or there is no key greater than the given one, /// then `None` is returned. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::U32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEU32 = U32<BigEndian>; /// /// let db = env.create_poly_database(Some("get-lt-u32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(27), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(42), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(43), &())?; /// /// let ret = db.get_greater_than::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(0))?; /// assert_eq!(ret, Some((BEU32::new(27), ()))); /// /// let ret = db.get_greater_than::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(42))?; /// assert_eq!(ret, Some((BEU32::new(43), ()))); /// /// let ret = db.get_greater_than::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(43))?; /// assert_eq!(ret, None); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn get_greater_than<'a, 'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, key: &'a KC::EItem, ) -> Result<Option<(KC::DItem, DC::DItem)>> where KC: BytesEncode<'a> + BytesDecode<'txn>, DC: BytesDecode<'txn>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; let entry = match cursor.move_on_key_greater_than_or_equal_to(&key_bytes)? { Some((key, data)) if key > &key_bytes[..] => Some((key, data)), Some((_key, _data)) => cursor.move_on_next()?, None => None, }; match entry { Some((key, data)) => match (KC::bytes_decode(key), DC::bytes_decode(data)) { (Some(key), Some(data)) => Ok(Some((key, data))), (_, _) => Err(Error::Decoding), }, None => Ok(None), } } /// Retrieves the key/value pair greater than or equal the given one in this database. /// /// If the database if empty or there is no key greater than or equal to the given one, /// then `None` is returned. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::U32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEU32 = U32<BigEndian>; /// /// let db = env.create_poly_database(Some("get-lt-u32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(27), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(42), &())?; /// db.put::<_, OwnedType<BEU32>, Unit>(&mut wtxn, &BEU32::new(43), &())?; /// /// let ret = db.get_greater_than_or_equal_to::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(0))?; /// assert_eq!(ret, Some((BEU32::new(27), ()))); /// /// let ret = db.get_greater_than_or_equal_to::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(42))?; /// assert_eq!(ret, Some((BEU32::new(42), ()))); /// /// let ret = db.get_greater_than_or_equal_to::<_, OwnedType<BEU32>, Unit>(&wtxn, &BEU32::new(44))?; /// assert_eq!(ret, None); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn get_greater_than_or_equal_to<'a, 'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, key: &'a KC::EItem, ) -> Result<Option<(KC::DItem, DC::DItem)>> where KC: BytesEncode<'a> + BytesDecode<'txn>, DC: BytesDecode<'txn>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; match cursor.move_on_key_greater_than_or_equal_to(&key_bytes) { Ok(Some((key, data))) => match (KC::bytes_decode(key), DC::bytes_decode(data)) { (Some(key), Some(data)) => Ok(Some((key, data))), (_, _) => Err(Error::Decoding), }, Ok(None) => Ok(None), Err(e) => Err(e), } } /// Retrieves the first key/value pair of this database. /// /// If the database if empty, then `None` is returned. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("first-poly-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// /// let ret = db.first::<_, OwnedType<BEI32>, Str>(&wtxn)?; /// assert_eq!(ret, Some((BEI32::new(27), "i-am-twenty-seven"))); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn first<'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, ) -> Result<Option<(KC::DItem, DC::DItem)>> where KC: BytesDecode<'txn>, DC: BytesDecode<'txn>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; match cursor.move_on_first() { Ok(Some((key, data))) => match (KC::bytes_decode(key), DC::bytes_decode(data)) { (Some(key), Some(data)) => Ok(Some((key, data))), (_, _) => Err(Error::Decoding), }, Ok(None) => Ok(None), Err(e) => Err(e), } } /// Retrieves the last key/value pair of this database. /// /// If the database if empty, then `None` is returned. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("last-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// /// let ret = db.last::<_, OwnedType<BEI32>, Str>(&wtxn)?; /// assert_eq!(ret, Some((BEI32::new(42), "i-am-forty-two"))); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn last<'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, ) -> Result<Option<(KC::DItem, DC::DItem)>> where KC: BytesDecode<'txn>, DC: BytesDecode<'txn>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; match cursor.move_on_last() { Ok(Some((key, data))) => match (KC::bytes_decode(key), DC::bytes_decode(data)) { (Some(key), Some(data)) => Ok(Some((key, data))), (_, _) => Err(Error::Decoding), }, Ok(None) => Ok(None), Err(e) => Err(e), } } /// Returns the number of elements in this database. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let ret = db.len(&wtxn)?; /// assert_eq!(ret, 4); /// /// db.delete::<_, OwnedType<BEI32>>(&mut wtxn, &BEI32::new(27))?; /// /// let ret = db.len(&wtxn)?; /// assert_eq!(ret, 3); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn len<'txn, T>(&self, txn: &'txn RoTxn<T>) -> Result<usize> { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; let mut count = 0; match cursor.move_on_first()? { Some(_) => count += 1, None => return Ok(0), } while let Some(_) = cursor.move_on_next()? { count += 1; } Ok(count) } /// Returns `true` if and only if this database is empty. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let ret = db.is_empty(&wtxn)?; /// assert_eq!(ret, false); /// /// db.clear(&mut wtxn)?; /// /// let ret = db.is_empty(&wtxn)?; /// assert_eq!(ret, true); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn is_empty<'txn, T>(&self, txn: &'txn RoTxn<T>) -> Result<bool> { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let mut cursor = RoCursor::new(txn, self.dbi)?; match cursor.move_on_first()? { Some(_) => Ok(false), None => Ok(true), } } /// Return a lexicographically ordered iterator of all key-value pairs in this database. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// /// let mut iter = db.iter::<_, OwnedType<BEI32>, Str>(&wtxn)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(13), "i-am-thirteen"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn iter<'txn, T, KC, DC>(&self, txn: &'txn RoTxn<T>) -> Result<RoIter<'txn, KC, DC>> { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); RoCursor::new(txn, self.dbi).map(|cursor| RoIter::new(cursor)) } /// Return a mutable lexicographically ordered iterator of all key-value pairs in this database. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// /// let mut iter = db.iter_mut::<_, OwnedType<BEI32>, Str>(&mut wtxn)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(13), "i-am-thirteen"))); /// let ret = unsafe { iter.del_current()? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// let ret = unsafe { iter.put_current(&BEI32::new(42), "i-am-the-new-forty-two")? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// /// let ret = db.get::<_, OwnedType<BEI32>, Str>(&wtxn, &BEI32::new(13))?; /// assert_eq!(ret, None); /// /// let ret = db.get::<_, OwnedType<BEI32>, Str>(&wtxn, &BEI32::new(42))?; /// assert_eq!(ret, Some("i-am-the-new-forty-two")); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn iter_mut<'txn, T, KC, DC>( &self, txn: &'txn mut RwTxn<T>, ) -> Result<RwIter<'txn, KC, DC>> { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); RwCursor::new(txn, self.dbi).map(|cursor| RwIter::new(cursor)) } /// Returns a reversed lexicographically ordered iterator of all key-value pairs in this database. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// /// let mut iter = db.rev_iter::<_, OwnedType<BEI32>, Str>(&wtxn)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(13), "i-am-thirteen"))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn rev_iter<'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, ) -> Result<RoRevIter<'txn, KC, DC>> { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); RoCursor::new(txn, self.dbi).map(|cursor| RoRevIter::new(cursor)) } /// Return a mutable reversed lexicographically ordered iterator of all key-value pairs /// in this database. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// /// let mut iter = db.rev_iter_mut::<_, OwnedType<BEI32>, Str>(&mut wtxn)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// let ret = unsafe { iter.del_current()? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(13), "i-am-thirteen"))); /// let ret = unsafe { iter.put_current(&BEI32::new(13), "i-am-the-new-thirteen")? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// /// let ret = db.get::<_, OwnedType<BEI32>, Str>(&wtxn, &BEI32::new(42))?; /// assert_eq!(ret, None); /// /// let ret = db.get::<_, OwnedType<BEI32>, Str>(&wtxn, &BEI32::new(13))?; /// assert_eq!(ret, Some("i-am-the-new-thirteen")); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn rev_iter_mut<'txn, T, KC, DC>( &self, txn: &'txn mut RwTxn<T>, ) -> Result<RwRevIter<'txn, KC, DC>> { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); RwCursor::new(txn, self.dbi).map(|cursor| RwRevIter::new(cursor)) } /// Return a lexicographically ordered iterator of a range of key-value pairs in this database. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let range = BEI32::new(27)..=BEI32::new(42); /// let mut iter = db.range::<_, OwnedType<BEI32>, Str, _>(&wtxn, &range)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn range<'a, 'txn, T, KC, DC, R>( &self, txn: &'txn RoTxn<T>, range: &'a R, ) -> Result<RoRange<'txn, KC, DC>> where KC: BytesEncode<'a>, R: RangeBounds<KC::EItem>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let start_bound = match range.start_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; let end_bound = match range.end_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; RoCursor::new(txn, self.dbi).map(|cursor| RoRange::new(cursor, start_bound, end_bound)) } /// Return a mutable lexicographically ordered iterator of a range of /// key-value pairs in this database. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let range = BEI32::new(27)..=BEI32::new(42); /// let mut range = db.range_mut::<_, OwnedType<BEI32>, Str, _>(&mut wtxn, &range)?; /// assert_eq!(range.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// let ret = unsafe { range.del_current()? }; /// assert!(ret); /// assert_eq!(range.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// let ret = unsafe { range.put_current(&BEI32::new(42), "i-am-the-new-forty-two")? }; /// assert!(ret); /// /// assert_eq!(range.next().transpose()?, None); /// drop(range); /// /// /// let mut iter = db.iter::<_, OwnedType<BEI32>, Str>(&wtxn)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(13), "i-am-thirteen"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(42), "i-am-the-new-forty-two"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(521), "i-am-five-hundred-and-twenty-one"))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn range_mut<'a, 'txn, T, KC, DC, R>( &self, txn: &'txn mut RwTxn<T>, range: &'a R, ) -> Result<RwRange<'txn, KC, DC>> where KC: BytesEncode<'a>, R: RangeBounds<KC::EItem>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let start_bound = match range.start_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; let end_bound = match range.end_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; RwCursor::new(txn, self.dbi).map(|cursor| RwRange::new(cursor, start_bound, end_bound)) } /// Return a reversed lexicographically ordered iterator of a range of key-value /// pairs in this database. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let range = BEI32::new(27)..=BEI32::new(43); /// let mut iter = db.rev_range::<_, OwnedType<BEI32>, Str, _>(&wtxn, &range)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn rev_range<'a, 'txn, T, KC, DC, R>( &self, txn: &'txn RoTxn<T>, range: &'a R, ) -> Result<RoRevRange<'txn, KC, DC>> where KC: BytesEncode<'a>, R: RangeBounds<KC::EItem>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let start_bound = match range.start_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; let end_bound = match range.end_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; RoCursor::new(txn, self.dbi).map(|cursor| RoRevRange::new(cursor, start_bound, end_bound)) } /// Return a mutable reversed lexicographically ordered iterator of a range of /// key-value pairs in this database. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let range = BEI32::new(27)..=BEI32::new(42); /// let mut range = db.rev_range_mut::<_, OwnedType<BEI32>, Str, _>(&mut wtxn, &range)?; /// assert_eq!(range.next().transpose()?, Some((BEI32::new(42), "i-am-forty-two"))); /// let ret = unsafe { range.del_current()? }; /// assert!(ret); /// assert_eq!(range.next().transpose()?, Some((BEI32::new(27), "i-am-twenty-seven"))); /// let ret = unsafe { range.put_current(&BEI32::new(27), "i-am-the-new-twenty-seven")? }; /// assert!(ret); /// /// assert_eq!(range.next().transpose()?, None); /// drop(range); /// /// /// let mut iter = db.iter::<_, OwnedType<BEI32>, Str>(&wtxn)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(13), "i-am-thirteen"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(27), "i-am-the-new-twenty-seven"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(521), "i-am-five-hundred-and-twenty-one"))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn rev_range_mut<'a, 'txn, T, KC, DC, R>( &self, txn: &'txn mut RwTxn<T>, range: &'a R, ) -> Result<RwRevRange<'txn, KC, DC>> where KC: BytesEncode<'a>, R: RangeBounds<KC::EItem>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let start_bound = match range.start_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; let end_bound = match range.end_bound() { Bound::Included(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Included(bytes.into_owned()) } Bound::Excluded(bound) => { let bytes = KC::bytes_encode(bound).ok_or(Error::Encoding)?; Bound::Excluded(bytes.into_owned()) } Bound::Unbounded => Bound::Unbounded, }; RwCursor::new(txn, self.dbi).map(|cursor| RwRevRange::new(cursor, start_bound, end_bound)) } /// Return a lexicographically ordered iterator of all key-value pairs /// in this database that starts with the given prefix. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-eight", &BEI32::new(28))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-seven", &BEI32::new(27))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-nine", &BEI32::new(29))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-one", &BEI32::new(41))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-two", &BEI32::new(42))?; /// /// let mut iter = db.prefix_iter::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty")?; /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-eight", BEI32::new(28)))); /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-nine", BEI32::new(29)))); /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-seven", BEI32::new(27)))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn prefix_iter<'a, 'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, prefix: &'a KC::EItem, ) -> Result<RoPrefix<'txn, KC, DC>> where KC: BytesEncode<'a>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let prefix_bytes = KC::bytes_encode(prefix).ok_or(Error::Encoding)?; let prefix_bytes = prefix_bytes.into_owned(); RoCursor::new(txn, self.dbi).map(|cursor| RoPrefix::new(cursor, prefix_bytes)) } /// Return a mutable lexicographically ordered iterator of all key-value pairs /// in this database that starts with the given prefix. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-eight", &BEI32::new(28))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-seven", &BEI32::new(27))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-nine", &BEI32::new(29))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-one", &BEI32::new(41))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-two", &BEI32::new(42))?; /// /// let mut iter = db.prefix_iter_mut::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty")?; /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-eight", BEI32::new(28)))); /// let ret = unsafe { iter.del_current()? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-nine", BEI32::new(29)))); /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-seven", BEI32::new(27)))); /// let ret = unsafe { iter.put_current("i-am-twenty-seven", &BEI32::new(27000))? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// /// let ret = db.get::<_, Str, OwnedType<BEI32>>(&wtxn, "i-am-twenty-eight")?; /// assert_eq!(ret, None); /// /// let ret = db.get::<_, Str, OwnedType<BEI32>>(&wtxn, "i-am-twenty-seven")?; /// assert_eq!(ret, Some(BEI32::new(27000))); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn prefix_iter_mut<'a, 'txn, T, KC, DC>( &self, txn: &'txn mut RwTxn<T>, prefix: &'a KC::EItem, ) -> Result<RwPrefix<'txn, KC, DC>> where KC: BytesEncode<'a>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let prefix_bytes = KC::bytes_encode(prefix).ok_or(Error::Encoding)?; let prefix_bytes = prefix_bytes.into_owned(); RwCursor::new(txn, self.dbi).map(|cursor| RwPrefix::new(cursor, prefix_bytes)) } /// Return a reversed lexicographically ordered iterator of all key-value pairs /// in this database that starts with the given prefix. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-eight", &BEI32::new(28))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-seven", &BEI32::new(27))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-nine", &BEI32::new(29))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-one", &BEI32::new(41))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-two", &BEI32::new(42))?; /// /// let mut iter = db.rev_prefix_iter::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty")?; /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-seven", BEI32::new(27)))); /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-nine", BEI32::new(29)))); /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-eight", BEI32::new(28)))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn rev_prefix_iter<'a, 'txn, T, KC, DC>( &self, txn: &'txn RoTxn<T>, prefix: &'a KC::EItem, ) -> Result<RoRevPrefix<'txn, KC, DC>> where KC: BytesEncode<'a>, { assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize); let prefix_bytes = KC::bytes_encode(prefix).ok_or(Error::Encoding)?; let prefix_bytes = prefix_bytes.into_owned(); RoCursor::new(txn, self.dbi).map(|cursor| RoRevPrefix::new(cursor, prefix_bytes)) } /// Return a mutable lexicographically ordered iterator of all key-value pairs /// in this database that starts with the given prefix. /// /// Comparisons are made by using the bytes representation of the key. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-eight", &BEI32::new(28))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-seven", &BEI32::new(27))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty-nine", &BEI32::new(29))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-one", &BEI32::new(41))?; /// db.put::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-forty-two", &BEI32::new(42))?; /// /// let mut iter = db.rev_prefix_iter_mut::<_, Str, OwnedType<BEI32>>(&mut wtxn, "i-am-twenty")?; /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-seven", BEI32::new(27)))); /// let ret = unsafe { iter.del_current()? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-nine", BEI32::new(29)))); /// assert_eq!(iter.next().transpose()?, Some(("i-am-twenty-eight", BEI32::new(28)))); /// let ret = unsafe { iter.put_current("i-am-twenty-eight", &BEI32::new(28000))? }; /// assert!(ret); /// /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// /// let ret = db.get::<_, Str, OwnedType<BEI32>>(&wtxn, "i-am-twenty-seven")?; /// assert_eq!(ret, None); /// /// let ret = db.get::<_, Str, OwnedType<BEI32>>(&wtxn, "i-am-twenty-eight")?; /// assert_eq!(ret, Some(BEI32::new(28000))); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn rev_prefix_iter_mut<'a, 'txn, T, KC, DC>( &self, txn: &'txn mut RwTxn<T>, prefix: &'a KC::EItem, ) -> Result<RwRevPrefix<'txn, KC, DC>> where KC: BytesEncode<'a>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let prefix_bytes = KC::bytes_encode(prefix).ok_or(Error::Encoding)?; let prefix_bytes = prefix_bytes.into_owned(); RwCursor::new(txn, self.dbi).map(|cursor| RwRevPrefix::new(cursor, prefix_bytes)) } /// Insert a key-value pairs in this database. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let ret = db.get::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27))?; /// assert_eq!(ret, Some("i-am-twenty-seven")); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn put<'a, T, KC, DC>( &self, txn: &mut RwTxn<T>, key: &'a KC::EItem, data: &'a DC::EItem, ) -> Result<()> where KC: BytesEncode<'a>, DC: BytesEncode<'a>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; let data_bytes: Cow<[u8]> = DC::bytes_encode(&data).ok_or(Error::Encoding)?; let mut key_val = unsafe { crate::into_val(&key_bytes) }; let mut data_val = unsafe { crate::into_val(&data_bytes) }; let flags = 0; unsafe { mdb_result(ffi::mdb_put( txn.txn.txn, self.dbi, &mut key_val, &mut data_val, flags, ))? } Ok(()) } /// Append the given key/data pair to the end of the database. /// /// This option allows fast bulk loading when keys are already known to be in the correct order. /// Loading unsorted keys will cause a MDB_KEYEXIST error. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("append-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let ret = db.get::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27))?; /// assert_eq!(ret, Some("i-am-twenty-seven")); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn append<'a, T, KC, DC>( &self, txn: &mut RwTxn<T>, key: &'a KC::EItem, data: &'a DC::EItem, ) -> Result<()> where KC: BytesEncode<'a>, DC: BytesEncode<'a>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; let data_bytes: Cow<[u8]> = DC::bytes_encode(&data).ok_or(Error::Encoding)?; let mut key_val = unsafe { crate::into_val(&key_bytes) }; let mut data_val = unsafe { crate::into_val(&data_bytes) }; let flags = ffi::MDB_APPEND; unsafe { mdb_result(ffi::mdb_put( txn.txn.txn, self.dbi, &mut key_val, &mut data_val, flags, ))? } Ok(()) } /// Deletes a key-value pairs in this database. /// /// If the key does not exist, then `false` is returned. /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let ret = db.delete::<_, OwnedType<BEI32>>(&mut wtxn, &BEI32::new(27))?; /// assert_eq!(ret, true); /// /// let ret = db.get::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27))?; /// assert_eq!(ret, None); /// /// let ret = db.delete::<_, OwnedType<BEI32>>(&mut wtxn, &BEI32::new(467))?; /// assert_eq!(ret, false); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn delete<'a, T, KC>(&self, txn: &mut RwTxn<T>, key: &'a KC::EItem) -> Result<bool> where KC: BytesEncode<'a>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let key_bytes: Cow<[u8]> = KC::bytes_encode(&key).ok_or(Error::Encoding)?; let mut key_val = unsafe { crate::into_val(&key_bytes) }; let result = unsafe { mdb_result(ffi::mdb_del( txn.txn.txn, self.dbi, &mut key_val, ptr::null_mut(), )) }; match result { Ok(()) => Ok(true), Err(e) if e.not_found() => Ok(false), Err(e) => Err(e.into()), } } /// Deletes a range of key-value pairs in this database. /// /// Perfer using [`clear`] instead of a call to this method with a full range ([`..`]). /// /// Comparisons are made by using the bytes representation of the key. /// /// [`clear`]: crate::Database::clear /// [`..`]: std::ops::RangeFull /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// let range = BEI32::new(27)..=BEI32::new(42); /// let ret = db.delete_range::<_, OwnedType<BEI32>, _>(&mut wtxn, &range)?; /// assert_eq!(ret, 2); /// /// let mut iter = db.iter::<_, OwnedType<BEI32>, Str>(&wtxn)?; /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(13), "i-am-thirteen"))); /// assert_eq!(iter.next().transpose()?, Some((BEI32::new(521), "i-am-five-hundred-and-twenty-one"))); /// assert_eq!(iter.next().transpose()?, None); /// /// drop(iter); /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn delete_range<'a, 'txn, T, KC, R>( &self, txn: &'txn mut RwTxn<T>, range: &'a R, ) -> Result<usize> where KC: BytesEncode<'a> + BytesDecode<'txn>, R: RangeBounds<KC::EItem>, { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); let mut count = 0; let mut iter = self.range_mut::<T, KC, DecodeIgnore, _>(txn, range)?; while iter.next().is_some() { // safety: We do not keep any reference from the database while using `del_current`. // The user can't keep any reference inside of the database as we ask for a // mutable reference to the `txn`. unsafe { iter.del_current()? }; count += 1; } Ok(count) } /// Deletes all key/value pairs in this database. /// /// Perfer using this method instead of a call to [`delete_range`] with a full range ([`..`]). /// /// [`delete_range`]: crate::Database::delete_range /// [`..`]: std::ops::RangeFull /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::Database; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put::<_, OwnedType<BEI32>, Str>(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// db.clear(&mut wtxn)?; /// /// let ret = db.is_empty(&wtxn)?; /// assert!(ret); /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn clear<T>(&self, txn: &mut RwTxn<T>) -> Result<()> { assert_eq!(self.env_ident, txn.txn.env.env_mut_ptr() as usize); unsafe { mdb_result(ffi::mdb_drop(txn.txn.txn, self.dbi, 0)).map_err(Into::into) } } /// Read this polymorphic database like a typed one, specifying the codecs. /// /// # Safety /// /// It is up to you to ensure that the data read and written using the polymorphic /// handle correspond to the the typed, uniform one. If an invalid write is made, /// it can corrupt the database from the eyes of heed. /// /// # Example /// /// ``` /// # use std::fs; /// # use std::path::Path; /// # use heed::EnvOpenOptions; /// use heed::{Database, PolyDatabase}; /// use heed::types::*; /// use heed::{zerocopy::I32, byteorder::BigEndian}; /// /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; /// # let env = EnvOpenOptions::new() /// # .map_size(10 * 1024 * 1024) // 10MB /// # .max_dbs(3000) /// # .open(Path::new("target").join("zerocopy.mdb"))?; /// type BEI32 = I32<BigEndian>; /// /// let db = env.create_poly_database(Some("iter-i32"))?; /// /// let mut wtxn = env.write_txn()?; /// # db.clear(&mut wtxn)?; /// // We remap the types for ease of use. /// let db = db.as_uniform::<OwnedType<BEI32>, Str>(); /// db.put(&mut wtxn, &BEI32::new(42), "i-am-forty-two")?; /// db.put(&mut wtxn, &BEI32::new(27), "i-am-twenty-seven")?; /// db.put(&mut wtxn, &BEI32::new(13), "i-am-thirteen")?; /// db.put(&mut wtxn, &BEI32::new(521), "i-am-five-hundred-and-twenty-one")?; /// /// wtxn.commit()?; /// # Ok(()) } /// ``` pub fn as_uniform<KC, DC>(&self) -> Database<KC, DC> { Database::new(self.env_ident, self.dbi) } }
use std::error::Error; use tokio::{self}; mod downloader; #[tokio::main] async fn main() -> Result<(), Box<dyn Error>> { let mut d1 = downloader::Downloader::new(None, None); d1.enque_file( "http://212.183.159.230/5MB.zip".to_string(), "./5mb.zip".to_string(), ); // let writer = downloader::Downloader::writer(d1.write_take_handle); d1.enque_file( "http://212.183.159.230/10MB.zip".to_string(), "./10mb.zip".to_string(), ); d1.start_download().await; Ok(()) }
use bitflags::bitflags; use bytes::{Buf, Bytes}; use crate::error::Error; use crate::mssql::io::MssqlBufExt; use crate::mssql::protocol::col_meta_data::Flags; #[cfg(test)] use crate::mssql::protocol::type_info::DataType; use crate::mssql::protocol::type_info::TypeInfo; #[allow(dead_code)] #[derive(Debug)] pub(crate) struct ReturnValue { param_ordinal: u16, param_name: String, status: ReturnValueStatus, user_type: u32, flags: Flags, pub(crate) type_info: TypeInfo, pub(crate) value: Option<Bytes>, } bitflags! { pub(crate) struct ReturnValueStatus: u8 { // If ReturnValue corresponds to OUTPUT parameter of a stored procedure invocation const OUTPUT_PARAM = 0x01; // If ReturnValue corresponds to return value of User Defined Function. const USER_DEFINED = 0x02; } } impl ReturnValue { pub(crate) fn get(buf: &mut Bytes) -> Result<Self, Error> { let ordinal = buf.get_u16_le(); let name = buf.get_b_varchar()?; let status = ReturnValueStatus::from_bits_truncate(buf.get_u8()); let user_type = buf.get_u32_le(); let flags = Flags::from_bits_truncate(buf.get_u16_le()); let type_info = TypeInfo::get(buf)?; let value = type_info.get_value(buf); Ok(Self { param_ordinal: ordinal, param_name: name, status, user_type, flags, type_info, value, }) } } #[test] fn test_get() { #[rustfmt::skip] let mut buf = Bytes::from_static(&[ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x26, 4, 4, 1, 0, 0, 0, 0xfe, 0, 0, 0xe0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]); let return_value = ReturnValue::get(&mut buf).unwrap(); assert_eq!(return_value.param_ordinal, 0); assert_eq!(return_value.param_name, ""); assert_eq!( return_value.status, ReturnValueStatus::from_bits_truncate(1) ); assert_eq!(return_value.user_type, 0); assert_eq!(return_value.flags, Flags::from_bits_truncate(0)); assert_eq!(return_value.type_info, TypeInfo::new(DataType::IntN, 4)); assert_eq!( return_value.value, Some(Bytes::from_static(&[0x01, 0, 0, 0])) ); }
mod expr_type_evaluator; mod field; mod field_mapper; mod ir; mod planner; mod planner_rewrite_expression; mod planner_time_range_expression; mod rewriter; mod test_utils; mod udf; mod util; mod var_ref; pub use planner::InfluxQLToLogicalPlan; pub use planner::SchemaProvider; pub(crate) use util::parse_regex;
// Copyright 2022 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::any::Any; use std::sync::Arc; use common_exception::Result; use common_pipeline_core::processors::port::OutputPort; use common_pipeline_core::processors::processor::Event; use common_pipeline_core::processors::processor::ProcessorPtr; use common_pipeline_core::processors::Processor; pub struct EmptySource { output: Arc<OutputPort>, } impl EmptySource { pub fn create(output: Arc<OutputPort>) -> Result<ProcessorPtr> { Ok(ProcessorPtr::create(Box::new(EmptySource { output }))) } } impl Processor for EmptySource { fn name(&self) -> String { "EmptySource".to_string() } fn as_any(&mut self) -> &mut dyn Any { self } fn event(&mut self) -> Result<Event> { self.output.finish(); Ok(Event::Finished) } }
use std::fs; use std::io::Write; use tokio::net::TcpListener; use tokio::prelude::*; mod camera; mod livestream; mod encode; mod inference_engine; mod timer; mod realtime; mod api; mod jpegdecode; #[cfg(windows)] use camera::camera_win::WindowsCamera; #[cfg(any(unix, macos))] use camera::camera_pi::PiCamera; use crate::camera::CameraProvider; use crate::livestream::*; use tungstenite::protocol::Message; use std::io::Cursor; use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian}; use tokio_tungstenite::accept_async as accept_ws; use crate::encode::encode_outcoming_message; use chrono::prelude::*; use tokio::sync::mpsc as achan; /* fn main(){ start_smartpi(); } #[no_mangle] pub extern "C" fn start_smartpi(){ let runtime=tokio::runtime::Runtime::new().unwrap(); runtime.block_on(async { tokio_main().await.unwrap(); }); } */ async fn tokio_main(tx: achan::Sender<IncomingMessage>) -> Result<(), Box<dyn std::error::Error>> { //#[cfg(windows)] //let camera=WindowsCamera::new(640, 480, 60); //#[cfg(any(unix, macos))] //let camera=PiCamera::new(640, 480, 50); //let worker=LiveStream::new(Box::new(camera)); //let ls=worker.start(); let mut listener = TcpListener::bind("0.0.0.0:17000").await?; loop { let sender=tx.clone(); let (socket, _) = listener.accept().await?; //let tx=worker.get_sender(); tokio::spawn(async move { let ws=accept_ws(socket).await.unwrap(); let mut client=LiveStreamClient::connect(sender).await; let info=client.stream_info().await; let (mut tx, mut rx)=ws.split(); //println!("({},{})", info.current_range.0, info.current_range.1); let ret=tx.send(Message::binary(encode::encode_outcoming_message(OutcomingMessage::CurrentInfo(info)))).await; if let Ok(_)=ret { while let Some(item) = rx.next().await { match item { Ok(Message::Binary(s)) => { //println!("message: {:?}", s); if s.len() < 9 { continue; } let mut arr: [u8; 8] = [0; 8]; for i in 0..=7 { arr[i] = s[i + 1]; } let arg = Cursor::new(arr).read_u64::<LittleEndian>().unwrap(); match s[0] { 0x0 => { // Info let info = client.stream_info().await; let ret=tx.send(Message::binary(encode::encode_outcoming_message(OutcomingMessage::CurrentInfo(info)))).await; match ret{ Err(_)=>{break;} Ok(_)=>{} } } 0x1 => { //FrameReq { //let timer=timer::Timer::new("uncompressed image"); let frame = client.request_batch(arg as usize).await; //println!("Sending"); let ret = tx.send(Message::binary(encode::encode_outcoming_message(OutcomingMessage::FrameArrive(frame)))).await; } //println!("Sent"); match ret{ Err(_)=>{break;} Ok(_)=>{} } } 0x2 => {} 0x3 => {} _ => {} } } Ok(_) => {} Err(x) => { break; } } } } //let (sink, stream)=ws.split(); client.destroy().await; }); } } /* fn main_camera() { println!("Hello, world!"); let mut camera = rscam::new("/dev/video0").unwrap(); camera.start(&rscam::Config { interval: (1, 60), // Try to run at 60 fps. resolution: (1280, 720), format: b"MJPG", ..Default::default() }).unwrap(); for i in 0..1000 { let frame = camera.capture().unwrap(); let mut file = fs::File::create(&format!("frame-{}.jpg", i)).unwrap(); file.write_all(&frame[..]).unwrap(); } } */ pub fn time_now()->usize{ let now = Utc::now(); let stamp=now.timestamp_millis() as usize; stamp }
use super::{ChannelID, UserID}; use deadpool_postgres::{Pool, PoolError}; use deadpool_postgres::tokio_postgres::Row; pub type MessageID = i32; pub async fn recent_messages(pool: Pool, channel_id: ChannelID) -> Result<Vec<Row>, PoolError> { let conn = pool.get().await?; let stmt = conn.prepare(" SELECT message_id, timestamp, COALESCE(author, 0), content FROM ( SELECT * FROM Message WHERE channel_id = $1 ORDER BY message_id DESC LIMIT 50 ) Temp ORDER BY message_id ASC ").await?; conn.query(&stmt, &[&channel_id]).await.map_err(|e| e.into()) } pub async fn old_messages(pool: Pool, channel_id: ChannelID, message_id: MessageID) -> Result<Vec<Row>, PoolError> { let conn = pool.get().await?; let stmt = conn.prepare(" SELECT message_id, timestamp, COALESCE(author, 0), content FROM ( SELECT * FROM Message WHERE channel_id = $1 AND message_id < $2 ORDER BY message_id DESC LIMIT 50 ) Temp ORDER BY message_id ASC ").await?; conn.query(&stmt, &[&channel_id, &message_id]).await.map_err(|e| e.into()) } pub async fn create_message( pool: Pool, time: std::time::SystemTime, user_id: UserID, content: &String, channel_id: ChannelID ) -> Result<MessageID, PoolError> { let conn = pool.get().await?; let stmt = conn.prepare(" INSERT INTO Message (timestamp, author, content, channel_id) VALUES ($1, $2, $3, $4) RETURNING message_id ").await?; Ok(conn.query_one(&stmt, &[&time, &user_id, content, &channel_id]).await?.get(0)) }
extern crate time; // Type alias for function that returns true if arguments should be swapped type OrderFunc<T> = Fn(&T, &T) -> bool; fn main() { let less_start_time = time::precise_time_ns(); // Sort numbers println!(""); let mut numbers = [80, 32, 19, 56, -15, 1, -1, 0, 782, 1]; println!("US: {:?}", numbers); quick_sort(&mut numbers, &is_more); println!("S: {:?}", numbers); // Sort strings println!(""); let mut strings = ["Hulk", "Captain America", "Black Widow", "Iron Man", "Thor", "Hawkeye"]; println!("US: {:?}", strings); quick_sort(&mut strings, &is_less); println!("S: {:?}", strings); //sort chars println!(""); let mut chars = ["b", "A", "h", "Z", "Q", "q"]; println!("US: {:?}", chars); quick_sort(&mut chars, &is_less); println!("S: {:?}", chars); let less_end_time = time::precise_time_ns(); //Testing Worst Case Scenario (One Unsorted Object at End Of List) let worst_start_time = time::precise_time_ns(); println!(""); let mut worst_numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; println!("US: {:?}", worst_numbers); quick_sort(&mut worst_numbers, &is_less); println!("S: {:?}", worst_numbers); let worst_end_time = time::precise_time_ns(); println!(""); println!("Time Taken (Three Sorts): {} Nanoseconds", less_end_time-less_start_time); println!("Time Taken (Worst Case Scenario): {} Nanoseconds", worst_end_time-worst_start_time); } // Example OrderFunc which is used to order items from least to greatest #[inline(always)] fn is_less<T: Ord>(x: &T, y: &T) -> bool { x < y } fn is_more<T: Ord>(x: &T, y: &T) -> bool { x > y } fn quick_sort<T>(group: &mut [T], function: &OrderFunc<T>) { let len = group.len(); if len < 2 { return; } let pivot_index = partition(group, function); // Sort the left side quick_sort(&mut group[0..pivot_index], function); // Sort the right side quick_sort(&mut group[pivot_index + 1..len], function); } fn partition<T>(group: &mut [T], function: &OrderFunc<T>) -> usize { let len = group.len(); let pivot_index = len / 2; group.swap(pivot_index, len - 1); let mut store_index = 0; for i in 0..len - 1 { if function(&group[i], &group[len - 1]) { group.swap(i, store_index); store_index += 1; } } group.swap(store_index, len - 1); store_index }
extern crate ggez; extern crate nalgebra; extern crate markedly; extern crate metrohash; use std::path::{PathBuf}; use nalgebra::{Point2, Vector2}; use metrohash::{MetroHashMap}; use ggez::conf::{NumSamples}; use ggez::graphics::{self, Rect, Font, Text, Canvas, Mesh}; use ggez::{Context, GameError}; use markedly::render::{Renderer}; use markedly::template::{Color}; use markedly::{Error, ComponentId}; struct FontCache { path: PathBuf, sizes: MetroHashMap<u32, Font>, } /// A persistent resource cache for the ggez markedly renderer. pub struct GgezCache { data: MetroHashMap<ComponentId, Canvas>, fonts: MetroHashMap<String, FontCache>, default_font: Option<String>, default_text_size: u32, } impl GgezCache { pub fn new() -> Self { GgezCache { data: MetroHashMap::default(), fonts: MetroHashMap::default(), default_font: None, default_text_size: 14, } } /// Adds a font to the cache by its path. /// This will not actually load the font until it's used with a specific size. pub fn add_font<S: Into<String>, P: Into<PathBuf>>( &mut self, name: S, location: P ) -> Result<(), Error> { let name = name.into(); if self.default_font.is_none() { self.default_font = Some(name.clone()); } if self.fonts.contains_key(&name) { return Err(Error::Resource { resource: Some(name), error: "Font already added to cache".into(), }) } self.fonts.insert(name, FontCache { path: location.into(), sizes: MetroHashMap::default(), }); Ok(()) } } /// A markedly renderer for ggez, intended to be constructed every frame on-demand. pub struct GgezRenderer<'a> { ctx: &'a mut Context, cache: &'a mut GgezCache, target_coordinates: Rect, } impl<'a> GgezRenderer<'a> { pub fn new(ctx: &'a mut Context, cache: &'a mut GgezCache) -> Self { let target_coordinates = graphics::get_screen_coordinates(ctx); GgezRenderer { ctx, cache, target_coordinates, } } fn render_to_component(&mut self, id: ComponentId) -> Result<(), Error> { let canvas = self.cache.data.get(&id).unwrap(); graphics::set_canvas(self.ctx, Some(canvas)); graphics::set_screen_coordinates(self.ctx, Rect::new( 0.0, 0.0, canvas.get_image().width() as f32, canvas.get_image().height() as f32, )).map_err(egtm)?; graphics::apply_transformations(self.ctx).map_err(egtm)?; Ok(()) } } impl<'a> Renderer for GgezRenderer<'a> { fn render_cache_to_target(&mut self, id: ComponentId) -> Result<(), Error> { graphics::set_canvas(self.ctx, None); graphics::set_screen_coordinates(self.ctx, self.target_coordinates).map_err(egtm)?; graphics::apply_transformations(self.ctx).map_err(egtm)?; let canvas = self.cache.data.get(&id).unwrap(); graphics::set_color(self.ctx, (255, 255, 255, 255).into()).map_err(egtm)?; graphics::draw(self.ctx, canvas, Point2::new(0.0, 0.0), 0.0).map_err(egtm)?; Ok(()) } fn create_resize_cache( &mut self, id: ComponentId, size: Vector2<u32> ) -> Result<bool, Error> { // If we have a cached canvas and it's of the right size, we only have to clear if let Some(canvas) = self.cache.data.get(&id) { if canvas.get_image().width() == size.x && canvas.get_image().height() == size.y { return Ok(false) } } // We don't have what we need so create a new canvas let canvas = Canvas::new(self.ctx, size.x, size.y, NumSamples::One).map_err(egtm)?; self.cache.data.insert(id, canvas); Ok(true) } fn clear_cache(&mut self, id: ComponentId) -> Result<(), Error> { let canvas = self.cache.data.get(&id).unwrap(); graphics::set_canvas(self.ctx, Some(canvas)); graphics::set_background_color(self.ctx, (255, 255, 255, 0).into()); graphics::clear(self.ctx); Ok(()) } fn render_cache( &mut self, id: ComponentId, source_id: ComponentId, position: Point2<f32> ) -> Result<(), Error> { self.render_to_component(id)?; let source_canvas = self.cache.data.get(&source_id).unwrap(); graphics::set_color(self.ctx, (255, 255, 255, 255).into()).map_err(egtm)?; graphics::draw(self.ctx, source_canvas, Point2::new( position.x.round(), position.y.round(), ), 0.0).map_err(egtm)?; Ok(()) } fn text( &mut self, id: ComponentId, text: &String, text_font: Option<&String>, text_size: Option<i32>, position: Point2<f32>, size: Vector2<f32>, color: Color, ) -> Result<(), Error> { self.render_to_component(id)?; // Try to find the font cache, use the default, or error if we can't find it let requested_font_name = text_font.or(self.cache.default_font.as_ref()) .ok_or(Error::Resource { resource: None, error: "Could not fall back to default font, no fonts are loaded".into() })?; let font_cache = self.cache.fonts.get_mut(requested_font_name) .ok_or_else(|| Error::Resource { resource: Some(requested_font_name.clone()), error: "Font is not in cache".into() })?; // Find the cached size for this font, or generate a cache for that let text_size = text_size.map(|v| v as u32).unwrap_or(self.cache.default_text_size); if !font_cache.sizes.contains_key(&text_size) { let font = Font::new(self.ctx, &font_cache.path, text_size).map_err(egtm)?; font_cache.sizes.insert(text_size, font); } let font = font_cache.sizes.get(&text_size).unwrap(); let text = Text::new(self.ctx, text, font).map_err(egtm)?; let x_offset = (size.x - text.width() as f32) * 0.5; let y_offset = (size.y - text.height() as f32) * 0.5; graphics::set_color(self.ctx, color_convert(color)).map_err(egtm)?; graphics::draw(self.ctx, &text, Point2::new( (position.x + x_offset).round(), (position.y + y_offset).round(), ), 0.0).map_err(egtm)?; Ok(()) } fn vertices( &mut self, id: ComponentId, vertices: &[Point2<f32>], indices: &[u16], color: Color, ) -> Result<(), Error> { self.render_to_component(id)?; graphics::set_color(self.ctx, color_convert(color)).map_err(egtm)?; // Convert the vertices+indices to triangles and then a mesh let mut flattened_vertices = Vec::new(); for index in indices { flattened_vertices.push(vertices[*index as usize]); } let mesh = Mesh::from_triangles(self.ctx, &flattened_vertices).map_err(egtm)?; graphics::draw(self.ctx, &mesh, Point2::new(0.0, 0.0), 0.0).map_err(egtm)?; Ok(()) } } fn color_convert(color: Color) -> ::ggez::graphics::Color { ::ggez::graphics::Color::new(color.red, color.green, color.blue, color.alpha) } /// Converts a ggez error to a markedly error. pub fn egtm(e: GameError) -> Error { Error::Generic { error: Box::new(e) } } /// Converts a markedly error to a ggez error. pub fn emtg(e: Error) -> GameError { GameError::UnknownError(format!("{:#?}", e)) }
use std::fmt::Debug; #[derive(PartialEq, Eq)] struct Variant { variant: String, } trait GetVariant where Self: Debug { fn get_variant(&self) -> Variant { let this_variant = format!("{:?}", self); let mut result = "".to_string(); for i in this_variant.chars() { if i == '(' { break; } result.push(i); } Variant { variant: result, } } } impl<T: Debug> GetVariant for Option<T> {} fn main() { println!("{:?}", Some(2)); println!("{}", Some(1).get_variant() == Some(2).get_variant() ); }
const FP_ILOGBNAN: i32 = -1 - 0x7fffffff; const FP_ILOGB0: i32 = FP_ILOGBNAN; #[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] pub fn ilogbf(x: f32) -> i32 { let mut i = x.to_bits(); let e = ((i >> 23) & 0xff) as i32; if e == 0 { i <<= 9; if i == 0 { force_eval!(0.0 / 0.0); return FP_ILOGB0; } /* subnormal x */ let mut e = -0x7f; while (i >> 31) == 0 { e -= 1; i <<= 1; } e } else if e == 0xff { force_eval!(0.0 / 0.0); if (i << 9) != 0 { FP_ILOGBNAN } else { i32::max_value() } } else { e - 0x7f } }
//! Initialization code #![feature(panic_implementation)] #![no_std] #[macro_use] extern crate cortex_m; #[macro_use] extern crate cortex_m_rt; extern crate f3; use core::panic::PanicInfo; use core::sync::atomic::{self, Ordering}; pub use cortex_m::asm::bkpt; pub use cortex_m::peripheral::ITM; use cortex_m_rt::ExceptionFrame; pub use f3::hal::delay::Delay; use f3::hal::i2c::I2c; pub use f3::hal::prelude; use f3::hal::prelude::*; use f3::hal::stm32f30x; pub use f3::hal::time::MonoTimer; pub use f3::lsm303dlhc::{I16x3, Sensitivity}; pub use f3::Lsm303dlhc; pub fn init() -> (Lsm303dlhc, Delay, MonoTimer, ITM) { let cp = cortex_m::Peripherals::take().unwrap(); let dp = stm32f30x::Peripherals::take().unwrap(); let mut flash = dp.FLASH.constrain(); let mut rcc = dp.RCC.constrain(); let clocks = rcc.cfgr.freeze(&mut flash.acr); let mut gpioe = dp.GPIOE.split(&mut rcc.ahb); let mut nss = gpioe .pe3 .into_push_pull_output(&mut gpioe.moder, &mut gpioe.otyper); nss.set_high(); let mut gpiob = dp.GPIOB.split(&mut rcc.ahb); let scl = gpiob.pb6.into_af4(&mut gpiob.moder, &mut gpiob.afrl); let sda = gpiob.pb7.into_af4(&mut gpiob.moder, &mut gpiob.afrl); let i2c = I2c::i2c1(dp.I2C1, (scl, sda), 400.khz(), clocks, &mut rcc.apb1); let lsm303dlhc = Lsm303dlhc::new(i2c).unwrap(); let delay = Delay::new(cp.SYST, clocks); let mono_timer = MonoTimer::new(cp.DWT, clocks); (lsm303dlhc, delay, mono_timer, cp.ITM) } #[allow(deprecated)] #[panic_implementation] fn panic(info: &PanicInfo) -> ! { let itm = unsafe { &mut *ITM::ptr() }; iprintln!(&mut itm.stim[0], "{}", info); bkpt(); loop { // add some side effect to prevent this from turning into a UDF (abort) instruction // see rust-lang/rust#28728 for details atomic::compiler_fence(Ordering::SeqCst) } } exception!(HardFault, hard_fault); fn hard_fault(_ef: &ExceptionFrame) -> ! { bkpt(); loop { atomic::compiler_fence(Ordering::SeqCst) } } exception!(*, default_handler); fn default_handler(_irqn: i16) { loop { atomic::compiler_fence(Ordering::SeqCst) } }
use heap::{Heap, HeapSessionId}; use ptr::Pointer; use std::fmt; use std::marker::PhantomData; use traits::IntoHeapAllocation; pub struct GcRef<'h, T: IntoHeapAllocation<'h>> { ptr: Pointer<T::In>, heap_id: HeapSessionId<'h>, } impl<'h, T: IntoHeapAllocation<'h>> GcRef<'h, T> { /// Pin an object, returning a new `GcRef` that will unpin it when /// dropped. Unsafe because if `p` is not a pointer to a live allocation of /// type `T::In` --- and a complete allocation, not a sub-object of one --- /// then later unsafe code will explode. pub unsafe fn new(p: Pointer<T::In>) -> GcRef<'h, T> { let heap: *const Heap = Heap::from_allocation::<T>(p); (*heap).pin::<T>(p); GcRef { ptr: p, heap_id: PhantomData, } } pub fn ptr(&self) -> Pointer<T::In> { self.ptr } pub fn as_ptr(&self) -> *const T::In { self.ptr.as_raw() } pub fn as_mut_ptr(&self) -> *mut T::In { self.ptr.as_raw() as *mut T::In } } impl<'h, T: IntoHeapAllocation<'h>> Drop for GcRef<'h, T> { fn drop(&mut self) { unsafe { let heap = Heap::from_allocation::<T>(self.ptr); (*heap).unpin::<T>(self.ptr); } } } impl<'h, T: IntoHeapAllocation<'h>> Clone for GcRef<'h, T> { fn clone(&self) -> GcRef<'h, T> { let &GcRef { ptr, heap_id } = self; unsafe { let heap = Heap::from_allocation::<T>(ptr); (*heap).pin::<T>(ptr); } GcRef { ptr: ptr, heap_id: heap_id, } } } impl<'h, T: IntoHeapAllocation<'h>> fmt::Debug for GcRef<'h, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "GcRef {{ ptr: {:p} }}", self.ptr.as_raw()) } } impl<'h, T: IntoHeapAllocation<'h>> PartialEq for GcRef<'h, T> { fn eq(&self, other: &GcRef<'h, T>) -> bool { self.ptr == other.ptr } } impl<'h, T: IntoHeapAllocation<'h>> Eq for GcRef<'h, T> {}
pub(crate) use _functools::make_module; #[pymodule] mod _functools { use crate::{function::OptionalArg, protocol::PyIter, PyObjectRef, PyResult, VirtualMachine}; #[pyfunction] fn reduce( function: PyObjectRef, iterator: PyIter, start_value: OptionalArg<PyObjectRef>, vm: &VirtualMachine, ) -> PyResult { let mut iter = iterator.iter_without_hint(vm)?; let start_value = if let OptionalArg::Present(val) = start_value { val } else { iter.next().transpose()?.ok_or_else(|| { let exc_type = vm.ctx.exceptions.type_error.to_owned(); vm.new_exception_msg( exc_type, "reduce() of empty sequence with no initial value".to_owned(), ) })? }; let mut accumulator = start_value; for next_obj in iter { accumulator = function.call((accumulator, next_obj?), vm)? } Ok(accumulator) } }
mod house { pub mod hosting { pub fn add() { } fn seat() { } } mod serving { fn take() {} fn order() {} } } pub fn eat_out() { crate::house::hosting::add(); house::hosting::add(); }
//! Tests for `#[graphql_subscription]` macro. pub mod common; use std::pin::Pin; use futures::{future, stream, FutureExt as _}; use juniper::{ execute, graphql_object, graphql_subscription, graphql_value, graphql_vars, resolve_into_stream, DefaultScalarValue, EmptyMutation, Executor, FieldError, FieldResult, GraphQLInputObject, GraphQLType, IntoFieldError, RootNode, ScalarValue, }; use self::common::util::extract_next; struct Query; #[graphql_object] impl Query { fn empty() -> bool { true } } fn schema<'q, C, Qry, Sub>( query_root: Qry, subscription_root: Sub, ) -> RootNode<'q, Qry, EmptyMutation<C>, Sub> where Qry: GraphQLType<DefaultScalarValue, Context = C, TypeInfo = ()> + 'q, Sub: GraphQLType<DefaultScalarValue, Context = C, TypeInfo = ()> + 'q, { RootNode::new(query_root, EmptyMutation::<C>::new(), subscription_root) } fn schema_with_scalar<'q, S, C, Qry, Sub>( query_root: Qry, subscription_root: Sub, ) -> RootNode<'q, Qry, EmptyMutation<C>, Sub, S> where Qry: GraphQLType<S, Context = C, TypeInfo = ()> + 'q, Sub: GraphQLType<S, Context = C, TypeInfo = ()> + 'q, S: ScalarValue + 'q, { RootNode::new_with_scalar_value(query_root, EmptyMutation::<C>::new(), subscription_root) } type Stream<'a, I> = Pin<Box<dyn futures::Stream<Item = I> + Send + 'a>>; mod trivial { use super::*; struct Human; #[graphql_subscription] impl Human { async fn id() -> Stream<'static, String> { Box::pin(stream::once(future::ready("human-32".into()))) } // TODO: Make work for `Stream<'_, String>`. async fn home_planet(&self) -> Stream<'static, String> { Box::pin(stream::once(future::ready("earth".into()))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { homePlanet }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"homePlanet": "earth"}), vec![])), ); } #[tokio::test] async fn is_graphql_object() { const DOC: &str = r#"{ __type(name: "Human") { kind } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok((graphql_value!({"__type": {"kind": "OBJECT"}}), vec![])), ); } #[tokio::test] async fn uses_type_name() { const DOC: &str = r#"{ __type(name: "Human") { name } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok((graphql_value!({"__type": {"name": "Human"}}), vec![])), ); } #[tokio::test] async fn has_no_description() { const DOC: &str = r#"{ __type(name: "Human") { description } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok((graphql_value!({"__type": {"description": null}}), vec![])), ); } } mod raw_method { use super::*; struct Human; #[graphql_subscription] impl Human { async fn r#my_id() -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } async fn r#async(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("async-32"))) } } #[tokio::test] async fn resolves_my_id_field() { const DOC: &str = r#"subscription { myId }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"myId": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_async_field() { const DOC: &str = r#"subscription { async }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"async": "async-32"}), vec![])), ); } #[tokio::test] async fn has_correct_name() { const DOC: &str = r#"{ __type(name: "Human") { name kind fields { name } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": { "name": "Human", "kind": "OBJECT", "fields": [{"name": "myId"}, {"name": "async"}], }}), vec![], )), ); } } mod ignored_method { use super::*; struct Human; #[graphql_subscription] impl Human { async fn id() -> Stream<'static, String> { Box::pin(stream::once(future::ready("human-32".into()))) } #[allow(dead_code)] #[graphql(ignore)] fn planet() -> &'static str { "earth" } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn is_not_field() { const DOC: &str = r#"{ __type(name: "Human") { fields { name } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [{"name": "id"}]}}), vec![], )), ); } } mod fallible_method { use super::*; struct CustomError; impl<S: ScalarValue> IntoFieldError<S> for CustomError { fn into_field_error(self) -> FieldError<S> { juniper::FieldError::new("Whatever", graphql_value!({"code": "some"})) } } struct Human; #[graphql_subscription] impl Human { async fn id(&self) -> Result<Stream<'static, String>, CustomError> { Ok(Box::pin(stream::once(future::ready("human-32".into())))) } async fn home_planet<__S>() -> FieldResult<Stream<'static, &'static str>, __S> { Ok(Box::pin(stream::once(future::ready("earth")))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { homePlanet }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"homePlanet": "earth"}), vec![])), ); } #[tokio::test] async fn has_correct_graphql_type() { const DOC: &str = r#"{ __type(name: "Human") { name kind fields { name type { kind ofType { name } } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": { "name": "Human", "kind": "OBJECT", "fields": [{ "name": "id", "type": {"kind": "NON_NULL", "ofType": {"name": "String"}}, }, { "name": "homePlanet", "type": {"kind": "NON_NULL", "ofType": {"name": "String"}}, }] }}), vec![], )), ); } } mod argument { use super::*; struct Human; #[graphql_subscription] impl Human { async fn id(arg: String) -> Stream<'static, String> { Box::pin(stream::once(future::ready(arg))) } async fn home_planet( &self, r#raw_arg: String, r#async: Option<i32>, ) -> Stream<'static, String> { Box::pin(stream::once(future::ready(format!("{raw_arg},{async:?}")))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id(arg: "human-32") }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { homePlanet(rawArg: "earth") }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"homePlanet": "earth,None"}), vec![])), ); } #[tokio::test] async fn has_correct_name() { const DOC: &str = r#"{ __type(name: "Human") { fields { name args { name } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [ {"name": "id", "args": [{"name": "arg"}]}, {"name": "homePlanet", "args": [{"name": "rawArg"}, {"name": "async"}]}, ]}}), vec![], )), ); } #[tokio::test] async fn has_no_description() { const DOC: &str = r#"{ __type(name: "Human") { fields { args { description } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [ {"args": [{"description": null}]}, {"args": [{"description": null}, {"description": null}]}, ]}}), vec![], )), ); } #[tokio::test] async fn has_no_defaults() { const DOC: &str = r#"{ __type(name: "Human") { fields { args { defaultValue } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [ {"args": [{"defaultValue": null}]}, {"args": [{"defaultValue": null}, {"defaultValue": null}]}, ]}}), vec![], )), ); } } mod default_argument { use super::*; #[derive(GraphQLInputObject, Debug)] struct Point { x: i32, } struct Human; #[graphql_subscription] impl Human { async fn id( &self, #[graphql(default)] arg1: i32, #[graphql(default = "second".to_string())] arg2: String, #[graphql(default = true)] r#arg3: bool, ) -> Stream<'static, String> { Box::pin(stream::once(future::ready(format!("{arg1}|{arg2}&{arg3}")))) } async fn info(#[graphql(default = Point { x: 1 })] coord: Point) -> Stream<'static, i32> { Box::pin(stream::once(future::ready(coord.x))) } } #[tokio::test] async fn resolves_id_field() { let schema = schema(Query, Human); for (input, expected) in [ ("subscription { id }", "0|second&true"), ("subscription { id(arg1: 1) }", "1|second&true"), (r#"subscription { id(arg2: "") }"#, "0|&true"), (r#"subscription { id(arg1: 2, arg2: "") }"#, "2|&true"), ( r#"subscription { id(arg1: 1, arg2: "", arg3: false) }"#, "1|&false", ), ] { assert_eq!( resolve_into_stream(input, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({ "id": expected }), vec![])), ); } } #[tokio::test] async fn resolves_info_field() { let schema = schema(Query, Human); for (input, expected) in [ ("subscription { info }", 1), ("subscription { info(coord: { x: 2 }) }", 2), ] { assert_eq!( resolve_into_stream(input, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({ "info": expected }), vec![])), ); } } #[tokio::test] async fn has_defaults() { const DOC: &str = r#"{ __type(name: "Human") { fields { args { name defaultValue type { name ofType { name } } } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [{ "args": [{ "name": "arg1", "defaultValue": "0", "type": {"name": null, "ofType": {"name": "Int"}}, }, { "name": "arg2", "defaultValue": r#""second""#, "type": {"name": null, "ofType": {"name": "String"}}, }, { "name": "arg3", "defaultValue": "true", "type": {"name": null, "ofType": {"name": "Boolean"}}, }], }, { "args": [{ "name": "coord", "defaultValue": "{x: 1}", "type": {"name": null, "ofType": {"name": "Point"}}, }], }]}}), vec![], )), ); } } mod generic { use super::*; struct Human<A = (), B: ?Sized = ()> { id: A, _home_planet: B, } #[graphql_subscription] impl<B: ?Sized + Sync> Human<i32, B> { async fn id(&self) -> Stream<'static, i32> { Box::pin(stream::once(future::ready(self.id))) } } #[graphql_subscription(name = "HumanString")] impl<B: ?Sized + Sync> Human<String, B> { async fn id(&self) -> Stream<'static, String> { Box::pin(stream::once(future::ready(self.id.clone()))) } } #[tokio::test] async fn resolves_human() { const DOC: &str = r#"subscription { id }"#; let schema = schema( Query, Human { id: 34i32, _home_planet: (), }, ); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": 34}), vec![])), ); } #[tokio::test] async fn resolves_human_string() { const DOC: &str = r#"subscription { id }"#; let schema = schema( Query, Human { id: "human-32".to_owned(), _home_planet: (), }, ); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn uses_type_name_without_type_params() { const DOC: &str = r#"{ __type(name: "Human") { name } }"#; let schema = schema( Query, Human { id: 0i32, _home_planet: (), }, ); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok((graphql_value!({"__type": {"name": "Human"}}), vec![])), ); } } mod generic_lifetime { use super::*; struct Human<'p, A = ()> { id: A, home_planet: &'p str, } #[graphql_subscription] impl<'p> Human<'p, i32> { async fn id(&self) -> Stream<'static, i32> { Box::pin(stream::once(future::ready(self.id))) } // TODO: Make it work with `Stream<'_, &str>`. async fn planet(&self) -> Stream<'static, String> { Box::pin(stream::once(future::ready(self.home_planet.into()))) } } #[graphql_subscription(name = "HumanString")] impl<'id, 'p> Human<'p, &'id str> { // TODO: Make it work with `Stream<'_, &str>`. async fn id(&self) -> Stream<'static, String> { Box::pin(stream::once(future::ready(self.id.into()))) } // TODO: Make it work with `Stream<'_, &str>`. async fn planet(&self) -> Stream<'static, String> { Box::pin(stream::once(future::ready(self.home_planet.into()))) } } #[tokio::test] async fn resolves_human_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema( Query, Human { id: 34i32, home_planet: "earth", }, ); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": 34}), vec![])), ); } #[tokio::test] async fn resolves_human_planet_field() { const DOC: &str = r#"subscription { planet }"#; let schema = schema( Query, Human { id: 34i32, home_planet: "earth", }, ); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"planet": "earth"}), vec![])), ); } #[tokio::test] async fn resolves_human_string_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema( Query, Human { id: "human-32", home_planet: "mars", }, ); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_human_string_planet_field() { const DOC: &str = r#"subscription { planet }"#; let schema = schema( Query, Human { id: "human-32", home_planet: "mars", }, ); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"planet": "mars"}), vec![])), ); } #[tokio::test] async fn uses_type_name_without_type_params() { const DOC: &str = r#"{ __type(name: "Human") { name } }"#; let schema = schema( Query, Human { id: 34i32, home_planet: "earth", }, ); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok((graphql_value!({"__type": {"name": "Human"}}), vec![])), ); } } mod description_from_doc_comment { use super::*; struct Human; /// Rust docs. #[graphql_subscription] impl Human { /// Rust `id` docs. /// Here. async fn id() -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } } #[tokio::test] async fn uses_doc_comment_as_description() { const DOC: &str = r#"{ __type(name: "Human") { description fields { description } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": { "description": "Rust docs.", "fields": [{"description": "Rust `id` docs.\nHere."}], }}), vec![], )), ); } } mod deprecation_from_attr { use super::*; struct Human; #[graphql_subscription] impl Human { async fn id() -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } #[deprecated] async fn a(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("a"))) } #[deprecated(note = "Use `id`.")] async fn b(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("b"))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_deprecated_a_field() { const DOC: &str = r#"subscription { a }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"a": "a"}), vec![])), ); } #[tokio::test] async fn resolves_deprecated_b_field() { const DOC: &str = r#"subscription { b }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"b": "b"}), vec![])), ); } #[tokio::test] async fn deprecates_fields() { const DOC: &str = r#"{ __type(name: "Human") { fields(includeDeprecated: true) { name isDeprecated } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [ {"name": "id", "isDeprecated": false}, {"name": "a", "isDeprecated": true}, {"name": "b", "isDeprecated": true}, ]}}), vec![], )), ); } #[tokio::test] async fn provides_deprecation_reason() { const DOC: &str = r#"{ __type(name: "Human") { fields(includeDeprecated: true) { name deprecationReason } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [ {"name": "id", "deprecationReason": null}, {"name": "a", "deprecationReason": null}, {"name": "b", "deprecationReason": "Use `id`."}, ]}}), vec![], )), ); } } mod explicit_name_description_and_deprecation { use super::*; struct Human; /// Rust docs. #[graphql_subscription(name = "MyHuman", desc = "My human.")] impl Human { /// Rust `id` docs. #[graphql(name = "myId", desc = "My human ID.", deprecated = "Not used.")] #[deprecated(note = "Should be omitted.")] async fn id( #[graphql(name = "myName", desc = "My argument.", default)] _n: String, ) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } #[graphql(deprecated)] #[deprecated(note = "Should be omitted.")] async fn a(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("a"))) } async fn b(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("b"))) } } #[tokio::test] async fn resolves_deprecated_id_field() { const DOC: &str = r#"subscription { myId }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"myId": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_deprecated_a_field() { const DOC: &str = r#"subscription { a }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"a": "a"}), vec![])), ); } #[tokio::test] async fn resolves_b_field() { const DOC: &str = r#"subscription { b }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"b": "b"}), vec![])), ); } #[tokio::test] async fn uses_custom_name() { const DOC: &str = r#"{ __type(name: "MyHuman") { name fields(includeDeprecated: true) { name args { name } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": { "name": "MyHuman", "fields": [ {"name": "myId", "args": [{"name": "myName"}]}, {"name": "a", "args": []}, {"name": "b", "args": []}, ], }}), vec![], )), ); } #[tokio::test] async fn uses_custom_description() { const DOC: &str = r#"{ __type(name: "MyHuman") { description fields(includeDeprecated: true) { name description args { description } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": { "description": "My human.", "fields": [{ "name": "myId", "description": "My human ID.", "args": [{"description": "My argument."}], }, { "name": "a", "description": null, "args": [], }, { "name": "b", "description": null, "args": [], }], }}), vec![], )), ); } #[tokio::test] async fn uses_custom_deprecation() { const DOC: &str = r#"{ __type(name: "MyHuman") { fields(includeDeprecated: true) { name isDeprecated deprecationReason } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": { "fields": [{ "name": "myId", "isDeprecated": true, "deprecationReason": "Not used.", }, { "name": "a", "isDeprecated": true, "deprecationReason": null, }, { "name": "b", "isDeprecated": false, "deprecationReason": null, }], }}), vec![], )), ); } } mod renamed_all_fields_and_args { use super::*; struct Human; #[graphql_subscription(rename_all = "none")] impl Human { async fn id() -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } async fn home_planet(&self, planet_name: String) -> Stream<'static, String> { Box::pin(stream::once(future::ready(planet_name))) } async fn r#async_info(r#my_num: i32) -> Stream<'static, i32> { Box::pin(stream::once(future::ready(r#my_num))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { home_planet(planet_name: "earth") }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"home_planet": "earth"}), vec![])), ); } #[tokio::test] async fn resolves_async_info_field() { const DOC: &str = r#"subscription { async_info(my_num: 3) }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"async_info": 3}), vec![])), ); } #[tokio::test] async fn uses_correct_fields_and_args_names() { const DOC: &str = r#"{ __type(name: "Human") { fields { name args { name } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [ {"name": "id", "args": []}, {"name": "home_planet", "args": [{"name": "planet_name"}]}, {"name": "async_info", "args": [{"name": "my_num"}]}, ]}}), vec![], )), ); } } mod explicit_scalar { use super::*; struct Human; #[graphql_subscription(scalar = DefaultScalarValue)] impl Human { async fn id(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } async fn home_planet() -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("earth"))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { homePlanet }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"homePlanet": "earth"}), vec![])), ); } } mod custom_scalar { use crate::common::MyScalarValue; use super::*; struct Human; #[graphql_subscription(scalar = MyScalarValue)] impl Human { async fn id(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } async fn home_planet() -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("earth"))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema_with_scalar::<MyScalarValue, _, _, _>(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { homePlanet }"#; let schema = schema_with_scalar::<MyScalarValue, _, _, _>(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"homePlanet": "earth"}), vec![])), ); } } mod explicit_generic_scalar { use std::marker::PhantomData; use super::*; struct Human<S>(PhantomData<S>); #[graphql_subscription(scalar = S)] impl<S: ScalarValue> Human<S> { async fn id(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } async fn home_planet(_executor: &Executor<'_, '_, (), S>) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("earth"))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human::<DefaultScalarValue>(PhantomData)); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { homePlanet }"#; let schema = schema(Query, Human::<DefaultScalarValue>(PhantomData)); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"homePlanet": "earth"}), vec![])), ); } } mod bounded_generic_scalar { use super::*; struct Human; #[graphql_subscription(scalar = S: ScalarValue + Clone)] impl Human { async fn id(&self) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human-32"))) } async fn home_planet<S>( _executor: &Executor<'_, '_, (), S>, ) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("earth"))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "human-32"}), vec![])), ); } #[tokio::test] async fn resolves_home_planet_field() { const DOC: &str = r#"subscription { homePlanet }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"homePlanet": "earth"}), vec![])), ); } } mod explicit_custom_context { use super::*; struct CustomContext(String); impl juniper::Context for CustomContext {} struct QueryRoot; #[graphql_object(context = CustomContext)] impl QueryRoot { fn empty() -> bool { true } } struct Human; #[graphql_subscription(context = CustomContext)] impl Human { // TODO: Make work for `Stream<'c, String>`. async fn id<'c>(&self, context: &'c CustomContext) -> Stream<'static, String> { Box::pin(stream::once(future::ready(context.0.clone()))) } // TODO: Make work for `Stream<'_, String>`. async fn info(_ctx: &()) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human being"))) } async fn more(#[graphql(context)] custom: &CustomContext) -> Stream<'static, String> { Box::pin(stream::once(future::ready(custom.0.clone()))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(QueryRoot, Human); let ctx = CustomContext("ctx!".into()); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &ctx) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "ctx!"}), vec![])), ); } #[tokio::test] async fn resolves_info_field() { const DOC: &str = r#"subscription { info }"#; let schema = schema(QueryRoot, Human); let ctx = CustomContext("ctx!".into()); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &ctx) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"info": "human being"}), vec![])), ); } #[tokio::test] async fn resolves_more_field() { const DOC: &str = r#"subscription { more }"#; let schema = schema(QueryRoot, Human); let ctx = CustomContext("ctx!".into()); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &ctx) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"more": "ctx!"}), vec![])), ); } } mod inferred_custom_context_from_field { use super::*; struct CustomContext(String); impl juniper::Context for CustomContext {} struct QueryRoot; #[graphql_object(context = CustomContext)] impl QueryRoot { fn empty() -> bool { true } } struct Human; #[graphql_subscription] impl Human { // TODO: Make work for `Stream<'c, String>`. async fn id<'c>(&self, context: &'c CustomContext) -> Stream<'static, String> { Box::pin(stream::once(future::ready(context.0.clone()))) } // TODO: Make work for `Stream<'_, String>`. async fn info(_ctx: &()) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("human being"))) } async fn more(#[graphql(context)] custom: &CustomContext) -> Stream<'static, String> { Box::pin(stream::once(future::ready(custom.0.clone()))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(QueryRoot, Human); let ctx = CustomContext("ctx!".into()); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &ctx) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "ctx!"}), vec![])), ); } #[tokio::test] async fn resolves_info_field() { const DOC: &str = r#"subscription { info }"#; let schema = schema(QueryRoot, Human); let ctx = CustomContext("ctx!".into()); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &ctx) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"info": "human being"}), vec![])), ); } #[tokio::test] async fn resolves_more_field() { const DOC: &str = r#"subscription { more }"#; let schema = schema(QueryRoot, Human); let ctx = CustomContext("ctx!".into()); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &ctx) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"more": "ctx!"}), vec![])), ); } } mod executor { use juniper::LookAheadMethods as _; use super::*; struct Human; #[graphql_subscription(scalar = S: ScalarValue)] impl Human { // TODO: Make work for `Stream<'e, &'e str>`. async fn id<'e, S>(&self, executor: &'e Executor<'_, '_, (), S>) -> Stream<'static, String> where S: ScalarValue, { Box::pin(stream::once(future::ready( executor.look_ahead().field_name().into(), ))) } async fn info<S>( &self, arg: String, #[graphql(executor)] _another: &Executor<'_, '_, (), S>, ) -> Stream<'static, String> { Box::pin(stream::once(future::ready(arg))) } // TODO: Make work for `Stream<'e, &'e str>`. async fn info2<'e, S>( _executor: &'e Executor<'_, '_, (), S>, ) -> Stream<'static, &'static str> { Box::pin(stream::once(future::ready("no info"))) } } #[tokio::test] async fn resolves_id_field() { const DOC: &str = r#"subscription { id }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"id": "id"}), vec![])), ); } #[tokio::test] async fn resolves_info_field() { const DOC: &str = r#"subscription { info(arg: "input!") }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"info": "input!"}), vec![])), ); } #[tokio::test] async fn resolves_info2_field() { const DOC: &str = r#"subscription { info2 }"#; let schema = schema(Query, Human); assert_eq!( resolve_into_stream(DOC, None, &schema, &graphql_vars! {}, &()) .then(|s| extract_next(s)) .await, Ok((graphql_value!({"info2": "no info"}), vec![])), ); } #[tokio::test] async fn not_arg() { const DOC: &str = r#"{ __type(name: "Human") { fields { name args { name } } } }"#; let schema = schema(Query, Human); assert_eq!( execute(DOC, None, &schema, &graphql_vars! {}, &()).await, Ok(( graphql_value!({"__type": {"fields": [ {"name": "id", "args": []}, {"name": "info", "args": [{"name": "arg"}]}, {"name": "info2", "args": []}, ]}}), vec![], )), ); } }
//! [![Documentation](https://docs.rs/ste/badge.svg)](https://docs.rs/ste) //! [![Crates](https://img.shields.io/crates/v/ste.svg)](https://crates.io/crates/ste) //! [![Actions Status](https://github.com/udoprog/audio/workflows/Rust/badge.svg)](https://github.com/udoprog/audio/actions) //! //! A single-threaded executor with some tricks up its sleeve. //! //! This was primarily written for use in [audio] as a low-latency way of //! interacting with a single background thread for audio-related purposes, but //! is otherwise a general purpose library that can be used to do anything. //! //! > **Soundness Warning:** This crate uses a fair bit of **unsafe**. Some of //! > the tricks employed needs to be rigirously sanity checked for safety //! > before you can rely on this for production uses. //! //! The default way to access the underlying thread is through the [submit] //! method. This blocks the current thread for the duration of the task allowing //! the background thread to access variables which are in scope. Like `n` //! below. //! //! ```rust //! # fn main() -> anyhow::Result<()> { //! let thread = ste::spawn(); //! //! let mut n = 10; //! thread.submit(|| n += 10); //! assert_eq!(20, n); //! //! thread.join(); //! # Ok(()) } //! ``` //! //! # Restricting thread access using tags //! //! This library provides the ability to construct a [Tag] which is uniquely //! associated with the thread that created it. This can then be used to ensure //! that data is only accessible by one thread. //! //! This is useful, because many APIs requires *thread-locality* where instances //! can only safely be used by the thread that created them. This is a low-level //! tool we provide which allows the safe implementation of `Send` for types //! which are otherwise `!Send`. //! //! Note that correctly using a [Tag] is hard, and incorrect use has severe //! safety implications. Make sure to study its documentation closely before //! use. //! //! ```rust //! struct Foo { //! tag: ste::Tag, //! } //! //! impl Foo { //! fn new() -> Self { //! Self { //! tag: ste::Tag::current_thread(), //! } //! } //! //! fn say_hello(&self) { //! self.tag.ensure_on_thread(); //! println!("Hello World!"); //! } //! } //! //! # fn main() -> anyhow::Result<()> { //! let thread = ste::spawn(); //! //! let foo = thread.submit(|| Foo::new()); //! //! thread.submit(|| { //! foo.say_hello(); // <- OK! //! }); //! //! thread.join(); //! # Ok(()) } //! ``` //! //! Using `say_hello` outside of the thread that created it is not fine and will //! panic to prevent racy access: //! //! ```rust,should_panic //! # struct Foo { tag: ste::Tag } //! # impl Foo { //! # fn new() -> Self { Self { tag: ste::Tag::current_thread() } } //! # fn say_hello(&self) { self.tag.ensure_on_thread(); } //! # } //! # fn main() -> anyhow::Result<()> { //! let thread = ste::spawn(); //! //! let foo = thread.submit(|| Foo::new()); //! //! foo.say_hello(); // <- Oops, panics! //! //! thread.join(); //! # Ok(()) } //! ``` //! //! # Known unsafety and soundness issues //! //! Below you can find a list of unsafe use and known soundness issues this //! library currently has. The soundness issues **must be fixed** before this //! library goes out of *alpha*. //! //! ## Pointers to stack-local addresses //! //! In order to efficiently share data between a thread calling [submit] and the //! background thread, the background thread references a fair bit of //! stack-local data from the calling thread which involves a fair bit of //! `unsafe`. //! //! While it should be possible to make this use *safe* (as is the hope of this //! library), it carries a risk that if the background thread were to proceed //! executing a task that is no longer synchronized properly with a caller of //! [submit] it might end up referencing data which is either no longer valid //! (use after free), or contains something else (dirty). //! //! ## Tag re-use //! //! [Tag] containers currently use a tag based on the address of a slab of //! allocated memory that is associated with each [Thread]. If however a //! [Thread] is shut down, and a new later recreated, there is a slight risk //! that this might re-use an existing memory address. //! //! Memory addresses are quite thankful to use, because they're cheap and quite //! easy to access. Due to this it might however be desirable to use a generated //! ID per thread instead which can for example abort a program in case it can't //! guarantee uniqueness. //! //! [audio]: https://github.com/udoprog/audio //! [submit]: https://docs.rs/ste/*/ste/struct.Thread.html#method.submit //! [Tag]: https://docs.rs/ste/*/ste/struct.Tag.html //! [Thread]: https://docs.rs/ste/*/ste/struct.Thread.html use std::future::Future; use std::io; use std::ptr; pub(crate) mod loom; use self::loom::thread; #[cfg(test)] mod tests; mod parker; use crate::parker::Parker; mod worker; use self::worker::{Entry, Prelude, Shared}; mod tag; use self::tag::with_tag; pub use self::tag::Tag; #[doc(hidden)] pub mod linked_list; mod wait_future; use self::wait_future::WaitFuture; mod misc; use self::misc::RawSend; /// Construct a default background thread executor. /// /// These both do the same thing, except the builder allows you to catch an OS error: /// /// ```rust /// # fn main() -> anyhow::Result<()> { /// let thread1 = ste::spawn(); /// let thread2 = ste::Builder::new().build()?; /// # Ok(()) } /// ``` pub fn spawn() -> Thread { Builder::new().build().expect("failed to spawn thread") } /// The handle for a background thread. /// /// The background thread can be interacted with in a couple of ways: /// * [submit][Thread::submit] - for submitted tasks, the call will block until /// it has been executed on the thread (or the thread has panicked). /// * [submit_async][Thread::submit_async] - for submitting asynchronous tasks, /// the call will block until it has been executed on the thread (or the /// thread has panicked). /// * [drop][Thread::drop] - for dropping value *on* the background thread. This /// is necessary for [Tag] values that requires drop. /// /// # Tasks panicking /// /// If anything on the background thread ends up panicking, the panic will be /// propagated but also isolated to that one task. /// /// Note that this is only true for unwinding panics. It would not apply to /// panics resulting in aborts. /// /// # Examples /// /// ```rust /// use std::sync::Arc; /// use std::panic::{AssertUnwindSafe, catch_unwind}; /// /// # fn main() -> anyhow::Result<()> { /// let thread = Arc::new(ste::spawn()); /// let mut threads = Vec::new(); /// /// for n in 0..10 { /// let thread = thread.clone(); /// /// threads.push(std::thread::spawn(move || { /// thread.submit(move || n) /// })); /// } /// /// let mut result = 0; /// /// for t in threads { /// result += t.join().unwrap(); /// } /// /// assert_eq!(result, (0..10).sum()); /// /// // Unwrap the thread. /// let thread = Arc::try_unwrap(thread).map_err(|_| "unwrap failed").unwrap(); /// /// let result = catch_unwind(AssertUnwindSafe(|| thread.submit(|| { /// panic!("Background thread: {:?}", std::thread::current().id()); /// }))); /// /// assert!(result.is_err()); /// /// println!("Main thread: {:?}", std::thread::current().id()); /// /// thread.join(); /// # Ok(()) } /// ``` #[must_use = "The thread should be joined with Thread::join once no longer used, \ otherwise it will block while being dropped."] pub struct Thread { /// Things that have been submitted for execution on the background thread. shared: ptr::NonNull<Shared>, /// The handle associated with the background thread. handle: Option<thread::JoinHandle<()>>, } /// Safety: The handle is both send and sync because it joins the background /// thread which keeps track of the state of `shared` and cleans it up once it's /// no longer needed. unsafe impl Send for Thread {} unsafe impl Sync for Thread {} impl Thread { /// Submit a task to run on the background thread. /// /// The call will block until it has been executed on the thread (or the /// thread has panicked). /// /// Because this function blocks until completion, it can safely access /// values which are outside of the scope of the provided closure. /// /// If you however need to store and access things which are `!Send`, you /// can wrap them in a container that ensures their thread-locality with /// [Tag] and then safely implement [Send] for it. /// /// # Examples /// /// ```rust /// # fn main() -> anyhow::Result<()> { /// let thread = ste::spawn(); /// /// let mut n = 10; /// thread.submit(|| n += 10); /// assert_eq!(20, n); /// /// thread.join(); /// # Ok(()) } /// ``` /// /// Unwinding panics as isolated on a per-task basis. /// /// ```rust /// use std::panic::{AssertUnwindSafe, catch_unwind}; /// /// # #[tokio::main(flavor = "current_thread")] /// # async fn main() -> anyhow::Result<()> { /// let thread = ste::spawn(); /// /// let result = catch_unwind(AssertUnwindSafe(|| thread.submit(|| panic!("woops")))); /// assert!(result.is_err()); /// /// let mut result = 0; /// thread.submit(|| { result += 1 }); /// assert_eq!(result, 1); /// /// thread.join(); /// # Ok(()) } /// ``` pub fn submit<F, T>(&self, task: F) -> T where F: Send + FnOnce() -> T, T: Send, { unsafe { let mut storage = None; let parker = Parker::new(); let mut task = into_task(task, RawSend(ptr::NonNull::from(&mut storage))); let entry = Entry::new(&mut task, ptr::NonNull::from(&parker)); // Safety: We're constructing a pointer to a local stack location. It // will never be null. // // The transmute is necessary because we're constructing a trait object // with a `'static` lifetime. self.shared .as_ref() .schedule_in_place(ptr::NonNull::from(&parker), entry); return match storage { Some(result) => result, None => panic!("background thread panicked"), }; } fn into_task<T, O>(task: T, mut storage: RawSend<Option<O>>) -> impl FnMut(Tag) + Send where T: FnOnce() -> O + Send, O: Send, { use std::panic; let mut task = Some(task); move |tag| { if let Some(task) = task.take() { let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| { let output = with_tag(tag, task); // Safety: we're the only one with access to this pointer, // and we know it hasn't been de-allocated yet. unsafe { *storage.0.as_mut() = Some(output); } })); } } } } /// Run the given future on the background thread. The future can reference /// memory outside of the current scope, but in order to do so, every time /// it is polled it has to be perfectly synchronized with a remote poll /// happening on the background thread. /// /// # Examples /// /// This method allows the spawned task to access things from its scope, /// assuming they are `Send`. The actual in the `async` task itself though /// will run on the background thread. /// /// ```rust /// # #[tokio::main(flavor = "current_thread")] /// # async fn main() -> anyhow::Result<()> { /// let thread = ste::Builder::new().with_tokio().build()?; /// /// let mut result = 1; /// /// thread.submit_async(async { /// tokio::time::sleep(std::time::Duration::from_secs(1)).await; /// println!("Hello!"); /// result += 1; /// }).await; /// /// assert_eq!(result, 2); /// thread.join(); /// # Ok(()) } /// ``` /// /// Panics as isolated on a per-task basis the same was as for /// [submit][Thread::submit]. They are propagated as a different panic to /// the calling thread. /// /// ```rust,should_panic /// # #[tokio::main(flavor = "current_thread")] /// # async fn main() -> anyhow::Result<()> { /// let thread = ste::spawn(); /// /// thread.submit_async(async move { panic!("woops") }).await; /// /// // Note: thread will still join correctly without panicking again. /// # Ok(()) } /// ``` pub async fn submit_async<F>(&self, mut future: F) -> F::Output where F: Send + Future, F::Output: Send, { // Parker to use during polling. let parker = Parker::new(); // Stack location where the output of the compuation is stored. let mut output = None; unsafe { let wait_future = WaitFuture { future: ptr::NonNull::from(&mut future), output: ptr::NonNull::from(&mut output), parker: ptr::NonNull::from(&parker), complete: false, shared: self.shared.as_ref(), }; wait_future.await } } /// Move the provided `value` onto the background thread and drop it. /// /// This is necessary for values which uses [Tag] to ensure that a type is /// not dropped incorrectly. /// /// # Examples /// /// ```rust /// struct Foo(ste::Tag); /// /// impl Drop for Foo { /// fn drop(&mut self) { /// self.0.ensure_on_thread(); /// } /// } /// /// # fn main() -> anyhow::Result<()> { /// let thread = ste::spawn(); /// /// let foo = thread.submit(|| Foo(ste::Tag::current_thread())); /// thread.drop(foo); /// /// thread.join(); /// # Ok(()) } /// ``` pub fn drop<T>(&self, value: T) where T: Send, { self.submit(move || drop(value)); } /// Join the background thread. /// /// Will block until the background thread is joined. /// /// This is the clean way to join a background thread, the alternative is to /// let [Thread] drop and this will be performed in the drop handler /// instead. /// /// # Examples /// /// ```rust /// # fn main() -> anyhow::Result<()> { /// let thread = ste::spawn(); /// /// let mut n = 10; /// thread.submit(|| n += 10); /// assert_eq!(20, n); /// /// thread.join(); /// # Ok(()) } /// ``` pub fn join(mut self) { if let Some(handle) = self.handle.take() { unsafe { self.shared.as_ref().outer_join() }; if handle.join().is_err() { panic!("background thread panicked"); } } } /// Construct the tag that is associated with the current thread externally /// from the thread. /// /// # Examples /// /// ```rust /// struct Foo(ste::Tag); /// /// impl Foo { /// fn say_hello(&self) { /// self.0.ensure_on_thread(); /// println!("Hello World"); /// } /// } /// /// # fn main() -> anyhow::Result<()> { /// let thread = ste::spawn(); /// /// let foo = Foo(thread.tag()); /// /// thread.submit(|| { /// foo.say_hello(); /// }); /// /// thread.join(); /// # Ok(()) } /// ``` pub fn tag(&self) -> Tag { Tag(self.shared.as_ptr() as usize) } } impl Drop for Thread { fn drop(&mut self) { // Note: we can safely ignore the result, because it will only error in // case the background thread has panicked. At which point we're still // free to assume it's no longer using the shared state. if let Some(handle) = self.handle.take() { unsafe { self.shared.as_ref().outer_join() }; let _ = handle.join(); } // Safety: at this point it's guaranteed that we've synchronized with // the thread enough that the shared state can be safely deallocated. // // The background thread is in one of two states: // * It has panicked, which means the shared state will not be used any // longer. // * It has successfully been joined in. Which has the same // implications. unsafe { let _ = Box::from_raw(self.shared.as_ptr()); } } } /// The builder for a [Thread] which can be configured a bit more. pub struct Builder { prelude: Option<Box<Prelude>>, #[cfg(feature = "tokio")] tokio: Option<tokio::runtime::Handle>, } impl Builder { /// Construct a new builder. pub fn new() -> Self { Self { prelude: None, #[cfg(feature = "tokio")] tokio: None, } } /// Enable tokio support. /// /// # Examples /// /// ```rust /// # #[tokio::main(flavor = "current_thread")] /// # async fn main() -> anyhow::Result<()> { /// let thread = ste::Builder::new().with_tokio().build()?; /// /// thread.submit_async(async { /// tokio::time::sleep(std::time::Duration::from_secs(1)).await; /// println!("Hello World!"); /// }); /// /// thread.join(); /// # Ok(()) } /// ``` #[cfg(feature = "tokio")] #[cfg_attr(docsrs, doc(cfg(feature = "tokio")))] pub fn with_tokio(self) -> Self { Self { tokio: Some(::tokio::runtime::Handle::current()), ..self } } /// Configure a prelude to the [Thread]. This is code that will run just as /// the thread is spinning up. /// /// # Examples /// /// ```rust /// fn say_hello(main_thread: std::thread::ThreadId) { /// println!("Hello from the prelude!"); /// assert_ne!(main_thread, std::thread::current().id()); /// } /// /// # fn main() -> anyhow::Result<()> { /// let main_thread = std::thread::current().id(); /// /// let thread = ste::Builder::new().prelude(move || say_hello(main_thread)).build(); /// # Ok(()) } /// ``` pub fn prelude<P>(self, prelude: P) -> Self where P: Fn() + Send + 'static, { Self { prelude: Some(Box::new(prelude)), ..self } } /// Construct the background thread. /// /// # Examples /// /// ```rust /// # fn main() -> anyhow::Result<()> { /// let thread = ste::Builder::new().build()?; /// thread.join(); /// # Ok(()) } /// ``` pub fn build(self) -> io::Result<Thread> { let shared = ptr::NonNull::from(Box::leak(Box::new(Shared::new()))); let prelude = self.prelude; #[cfg(feature = "tokio")] let tokio = self.tokio; let shared2 = RawSend(shared); let handle = thread::Builder::new() .name(String::from("ste-thread")) .spawn(move || { let RawSend(shared) = shared2; #[cfg(feature = "tokio")] let _guard = tokio.as_ref().map(|h| h.enter()); worker::run(prelude, shared) })?; Ok(Thread { shared, handle: Some(handle), }) } }
use crate::pickledb::PickleDb; use serde::Serialize; /// A struct for extending PickleDB lists and adding more items to them pub struct PickleDbListExtender<'a> { pub(crate) db: &'a mut PickleDb, pub(crate) list_name: String, } impl<'a> PickleDbListExtender<'a> { /// Add a single item to an existing list. /// /// As mentioned before, the lists are heterogeneous, meaning a single list can contain /// items of different types. That means that the item can be of any type that is serializable. /// That includes all primitive types, vectors, tuples and every struct that has the /// `#[derive(Serialize, Deserialize)` attribute. /// The method returns another `PickleDbListExtender` object that enables to continue adding /// items to the list. /// /// # Arguments /// /// * `value` - a reference of the item to add to the list /// /// # Examples /// /// ```no_run /// # let mut db = pickledb::PickleDb::new_bin("1.db", pickledb::PickleDbDumpPolicy::AutoDump); /// // create a new list /// db.lcreate("list1").unwrap() /// /// // add items of different types to the list /// .ladd(&100) /// .ladd(&String::from("my string")) /// .ladd(&vec!["aa", "bb", "cc"]); /// ``` /// pub fn ladd<V>(&mut self, value: &V) -> PickleDbListExtender where V: Serialize, { self.db.ladd(&self.list_name, value).unwrap() } /// Add multiple items to an existing list. /// /// As mentioned before, the lists are heterogeneous, meaning a single list can contain /// items of different types. That means that the item can be of any type that is serializable. /// That includes all primitive types, vectors, tuples and every struct that has the /// `#[derive(Serialize, Deserialize)` attribute. /// This method adds multiple items to the list, but since they're in a vector that means all /// of them are of the same type. Of course it doesn't mean that the list cannot contain items /// of other types as well, as you can see in the example below. /// The method returns another `PickleDbListExtender` object that enables to continue adding /// items to the list. /// /// # Arguments /// /// * `seq` - an iterator containing references to the new items to add to the list /// /// # Examples /// /// ```no_run /// # let mut db = pickledb::PickleDb::new_bin("1.db", pickledb::PickleDbDumpPolicy::AutoDump); /// // create a new list /// db.lcreate("list1"); /// /// // add a bunch of numbers to the list /// db.lextend("list1", &vec![100, 200, 300]).unwrap() /// /// // add a bunch of strings to the list /// .lextend(&vec!["aa", "bb", "cc"]); /// /// // now the list contains 6 items and looks like this: [100, 200, 300, "aa, "bb", "cc"] /// ``` /// pub fn lextend<'i, V, I>(&mut self, seq: I) -> PickleDbListExtender where V: 'i + Serialize, I: IntoIterator<Item = &'i V>, { self.db.lextend(&self.list_name, seq).unwrap() } }
use crate::{ core::{ error::Error, frame_buffer::{FrameBuffer, FrameBufferRef}, header::HeaderRef, version::Version, LevelMode, LevelRoundingMode, }, multi_part::multi_part_input_file::MultiPartInputFile, }; use imath_traits::Bound2; use openexr_sys as sys; use std::ffi::CStr; use std::fmt::Debug; use std::path::PathBuf; type Result<T, E = Error> = std::result::Result<T, E>; pub struct TiledInputPart<'a> { pub(crate) inner: sys::Imf_TiledInputPart_t, // The MultiPartInputFile is borrowed in the TiledInputPart, so we need to // make sure that its lifetime is longer than the TiledInputPart. phantom: std::marker::PhantomData<&'a MultiPartInputFile>, } impl<'a> Debug for TiledInputPart<'a> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("TiledInputPart") .field("file_name", &self.file_name()) .finish() } } impl<'a> TiledInputPart<'a> { pub fn new( multi_part_file: &'a MultiPartInputFile, part_number: i32, ) -> Self { let mut inner = std::mem::MaybeUninit::uninit(); unsafe { sys::Imf_TiledInputPart_ctor( inner.as_mut_ptr(), multi_part_file.0, part_number, ) .into_result() .unwrap(); Self { inner: inner.assume_init(), phantom: std::marker::PhantomData, } } } /// Access to the file path /// pub fn file_name(&self) -> PathBuf { let mut ptr = std::ptr::null(); unsafe { sys::Imf_TiledInputPart_fileName(&self.inner, &mut ptr) .into_result() .unwrap(); // TODO: Validate if OpenEXR will always return a valid string, or // if we need to return a Result<PathBuf, Error>. if ptr.is_null() { panic!( "Received null ptr from sys::Imf_TiledInputPart_fileName" ); } let file_name = CStr::from_ptr(ptr); PathBuf::from( file_name.to_str().expect("Invalid bytes in filename"), ) } } /// Access to the file header /// pub fn header(&self) -> HeaderRef { let mut ptr = std::ptr::null(); unsafe { sys::Imf_TiledInputPart_header(&self.inner, &mut ptr) .into_result() .unwrap(); // TODO: Validate if OpenEXR will always return a valid header, or // if we need to return a Result<Header, Error>. if ptr.is_null() { panic!("Received null ptr from sys::Imf_TiledInputPart_header"); } } HeaderRef::new(ptr) } /// Access to the file format version /// pub fn version(&self) -> Version { let mut version = 0; unsafe { sys::Imf_TiledInputPart_version(&self.inner, &mut version) .into_result() .unwrap(); } Version::from_c_int(version) } /// Set the current frame buffer -- copies the FrameBuffer /// object into the TiledInputPart object. /// /// The current frame buffer is the destination for the pixel /// data read from the file. The current frame buffer must be /// set at least once before read_tile() is called. /// The current frame buffer can be changed after each call /// to read_tile(). /// /// # Errors /// * [`Error::InvalidArgument`] - if the sampling factors do not match or /// if the frame buffer does not have a sample count slice. /// pub fn set_frame_buffer( &mut self, frame_buffer: &FrameBuffer, ) -> Result<()> { unsafe { // Assume that the frame buffer is valid, since it is coming from // Rust. sys::Imf_TiledInputPart_setFrameBuffer( &mut self.inner, frame_buffer.ptr, ) .into_result()?; } Ok(()) } /// Access to the current frame buffer /// pub fn frame_buffer(&self) -> FrameBufferRef { let mut ptr = std::ptr::null(); unsafe { sys::Imf_TiledInputPart_frameBuffer(&self.inner, &mut ptr) .into_result() .unwrap(); // TODO: Validate if OpenEXR will always return a valid frame // buffer, or if we need to return a Result<FrameBufferRef, Error>. if ptr.is_null() { panic!("Received null ptr from sys::Imf_TiledInputPart_frameBuffer"); } } FrameBufferRef::new(ptr) } /// Check if all pixels in the data window are present in the input file /// pub fn is_complete(&self) -> bool { let mut v = false; unsafe { sys::Imf_TiledInputPart_isComplete(&self.inner, &mut v); } v } /// Get the tiles' x dimension /// pub fn tile_x_size(&self) -> u32 { let mut v = 0; unsafe { sys::Imf_TiledInputPart_tileXSize(&self.inner, &mut v) .into_result() .expect( "Unexpected exception from Imf_TiledInputPart_tileXSize", ); } v } /// Get the tiles' y dimension /// pub fn tile_y_size(&self) -> u32 { let mut v = 0; unsafe { sys::Imf_TiledInputPart_tileYSize(&self.inner, &mut v) .into_result() .expect( "Unexpected exception from Imf_TiledInputPart_tileYSize", ); } v } /// Get the level mode /// pub fn level_mode(&self) -> LevelMode { let mut v = sys::Imf_LevelMode(0); unsafe { sys::Imf_TiledInputPart_levelMode(&self.inner, &mut v) .into_result() .expect( "Unexpected exception from Imf_TiledInputPart_levelMode", ); } v.into() } /// Get the level rounding mode /// pub fn level_rounding_mode(&self) -> LevelRoundingMode { let mut v = sys::Imf_LevelRoundingMode(0); unsafe { sys::Imf_TiledInputPart_levelRoundingMode( &self.inner, &mut v, ) .into_result() .expect( "Unexpected exception from Imf_TiledInputPart_levelRoundingMode", ); } v.into() } /// Get the number of levels in the file /// /// # Returns /// * `Ok(1)` if [`TiledInputPart::level_mode()`] == [`LevelMode::OneLevel`] /// * `Ok(rfunc (log (max (w, h)) / log (2)) + 1)` if [`TiledInputPart::level_mode()`] == [`LevelMode::MipmapLevels`] /// * `Err(Error::Logic)` if [`TiledInputPart::level_mode()`] == [`LevelMode::RipmapLevels`] /// /// where `rfunc` is either `floor()` or `ceil()` depending on whether /// [`TiledInputPart::level_rounding_mode()`] is [`LevelRoundingMode::RoundUp`] or [`LevelRoundingMode::RoundDown`] /// pub fn num_levels(&self) -> Result<i32> { let mut v = 0; unsafe { sys::Imf_TiledInputPart_numLevels(&self.inner, &mut v) .into_result()?; } Ok(v) } /// Get the number of levels in the file in the x axis /// /// # Returns /// * `1` if [`TiledInputPart::level_mode()`] == [`LevelMode::OneLevel`] /// * `rfunc (log (max (w, h)) / log (2)) + 1` if [`TiledInputPart::level_mode()`] == [`LevelMode::MipmapLevels`] /// * `rfunc (log (w) / log (2)) + 1` if [`TiledInputPart::level_mode()`] == [`LevelMode::RipmapLevels`] /// /// where `rfunc` is either `floor()` or `ceil()` depending on whether /// [`TiledInputPart::level_rounding_mode()`] is [`LevelRoundingMode::RoundUp`] or [`LevelRoundingMode::RoundDown`] /// pub fn num_x_levels(&self) -> i32 { let mut v = 0; unsafe { sys::Imf_TiledInputPart_numXLevels(&self.inner, &mut v) .into_result() .expect( "Unexpected exception from Imf_TiledInputPart_numXLevels", ); } v } /// Get the number of levels in the file in the x axis /// /// # Returns /// * `1` if [`TiledInputPart::level_mode()`] == [`LevelMode::OneLevel`] /// * `rfunc (log (max (w, h)) / log (2)) + 1` if [`TiledInputPart::level_mode()`] == [`LevelMode::MipmapLevels`] /// * `rfunc (log (h) / log (2)) + 1` if [`TiledInputPart::level_mode()`] == [`LevelMode::RipmapLevels`] /// /// where `rfunc` is either `floor()` or `ceil()` depending on whether /// [`TiledInputPart::level_rounding_mode()`] is [`LevelRoundingMode::RoundUp`] or [`LevelRoundingMode::RoundDown`] /// pub fn num_y_levels(&self) -> i32 { let mut v = 0; unsafe { sys::Imf_TiledInputPart_numYLevels(&self.inner, &mut v) .into_result() .expect( "Unexpected exception from Imf_TiledInputPart_numYLevels", ); } v } /// Returns `true` if the file contains a level with level number `(lx, ly)`, `false` /// otherwise. /// pub fn is_valid_level(&self, lx: i32, ly: i32) -> bool { let mut v = false; unsafe { sys::Imf_TiledInputPart_isValidLevel(&self.inner, &mut v, lx, ly) .into_result() .expect( "Unexpected exception from Imf_TiledInputPart_isValidLevel", ); } v } /// Returns the width of the level with level number `(lx, *)`, where `*` is any number. /// /// # Returns /// * `max (1, rfunc (w / pow (2, lx)))` /// /// where `rfunc` is either `floor()` or `ceil()` depending on whether /// [`TiledInputPart::level_rounding_mode()`] is [`LevelRoundingMode::RoundUp`] or [`LevelRoundingMode::RoundDown`] /// /// # Errors /// *[`Error::Base`] - If any error occurs /// pub fn level_width(&self, lx: i32) -> Result<i32> { let mut v = 0; unsafe { sys::Imf_TiledInputPart_levelWidth(&self.inner, &mut v, lx) .into_result()?; } Ok(v) } /// Returns the height of the level with level number `(*, ly)`, where `*` is any number. /// /// # Returns /// * `max (1, rfunc (h / pow (2, ly)))` /// /// where `rfunc` is either `floor()` or `ceil()` depending on whether /// [`TiledInputPart::level_rounding_mode()`] is [`LevelRoundingMode::RoundUp`] or [`LevelRoundingMode::RoundDown`] /// /// # Errors /// *[`Error::Base`] - If any error occurs /// pub fn level_height(&self, ly: i32) -> Result<i32> { let mut v = 0; unsafe { sys::Imf_TiledInputPart_levelHeight(&self.inner, &mut v, ly) .into_result()?; } Ok(v) } /// Get the number of tiles in the x axis that cover a level with level number `(lx, *)` /// where `*` is any number /// /// # Returns /// *(level_width(lx) + tile_x_size() - 1) / tile_x_size() /// /// # Errors /// *[`Error::InvalidArgument`] - If `lx` is not a valid level /// pub fn num_x_tiles(&self, lx: i32) -> Result<i32> { let mut v = 0; unsafe { sys::Imf_TiledInputPart_numXTiles(&self.inner, &mut v, lx) .into_result()?; } Ok(v) } /// Get the number of tiles in the y axis that cover a level with level number `(*, ly)` /// where `*` is any number /// /// # Returns /// * (level_height(ly) + tile_y_size() - 1) / tile_y_size() /// /// # Errors /// *[`Error::InvalidArgument`] - If `lx` is not a valid level /// pub fn num_y_tiles(&self, ly: i32) -> Result<i32> { let mut v = 0; unsafe { sys::Imf_TiledInputPart_numYTiles(&self.inner, &mut v, ly) .into_result()?; } Ok(v) } /// Returns a 2-dimensional region of valid pixel coordinates for a level with level number `(lx, ly)` /// /// # Errors /// *[`Error::Base`] - if any error occurs /// pub fn data_window_for_level<B: Bound2<i32>>( &self, lx: i32, ly: i32, ) -> Result<B> { let mut dw = [0i32; 4]; unsafe { sys::Imf_TiledInputPart_dataWindowForLevel( &self.inner, dw.as_mut_ptr() as *mut sys::Imath_Box2i_t, lx, ly, ) .into_result()?; } Ok(B::from_slice(&dw)) } /// Returns a 2-dimensional region of valid pixel coordinates for a level with tile coordinates `(dx, dy)` and level number `(lx, ly)` /// /// # Errors /// * [`Error::InvalidArgument`] - if the passed tile coordinates are invalid /// * [`Error::Base`] - if any other error occurs /// pub fn data_window_for_tile<B: Bound2<i32>>( &self, dx: i32, dy: i32, lx: i32, ly: i32, ) -> Result<B> { let mut dw = [0i32; 4]; unsafe { sys::Imf_TiledInputPart_dataWindowForTile( &self.inner, dw.as_mut_ptr() as *mut sys::Imath_Box2i_t, dx, dy, lx, ly, ) .into_result()?; } Ok(B::from_slice(&dw)) } /// Reads the tile with tile coordinates `(dx, dy)`, and level number `(lx, ly)`, /// and stores it in the current frame buffer. /// /// # Errors /// * [`Error::InvalidArgument`] - if dx does not lie in the interval [0, num_x_tiles(lx)-1] /// * [`Error::InvalidArgument`] - if dy does not lie in the interval [0, num_y_tiles(ly)-1] /// /// * [`Error::InvalidArgument`] -if lx does not lie in the interval [0, num_x_levels()-1] /// * [`Error::InvalidArgument`] -if ly does not lie in the inverval [0, num_y_levels()-1] /// * [`Error::Io`] - if there is an error reading data from the file /// * [`Error::Base`] - if any other error occurs /// pub fn read_tile( &mut self, dx: i32, dy: i32, lx: i32, ly: i32, ) -> Result<()> { unsafe { sys::Imf_TiledInputPart_readTile(&mut self.inner, dx, dy, lx, ly) .into_result()?; } Ok(()) } /// Reads the sample counts in tile range with coordinates `(dx1, dy1)`, to `(dx2, dy2)` and level number `(lx, ly)`, /// and stores it in the current frame buffer. /// /// # Errors /// * [`Error::InvalidArgument`] - if dx does not lie in the interval [0, num_x_tiles(lx)-1] /// * [`Error::InvalidArgument`] - if dy does not lie in the interval [0, num_y_tiles(ly)-1] /// /// * [`Error::InvalidArgument`] -if lx does not lie in the interval [0, num_x_levels()-1] /// * [`Error::InvalidArgument`] -if ly does not lie in the inverval [0, num_y_levels()-1] /// * [`Error::Io`] - if there is an error reading data from the file /// * [`Error::Base`] - if any other error occurs /// pub fn read_tiles( &mut self, dx1: i32, dx2: i32, dy1: i32, dy2: i32, lx: i32, ly: i32, ) -> Result<()> { unsafe { sys::Imf_TiledInputPart_readTiles( &mut self.inner, dx1, dx2, dy1, dy2, lx, ly, ) .into_result()?; } Ok(()) } } #[cfg(test)] mod tests { use std::path::PathBuf; use crate::{ core::{frame_buffer::FrameBuffer, LevelMode, LevelRoundingMode}, multi_part::multi_part_input_file::MultiPartInputFile, tiled::tiled_input_part::TiledInputPart, }; lazy_static::lazy_static! { static ref SRC_IMAGE_PATH: PathBuf = { PathBuf::from( std::env::var("CARGO_MANIFEST_DIR") .expect("CARGO_MANIFEST_DIR not set"), ) .join("images") .join("ferris-tiled.exr") }; } #[test] fn test_tiledinputpart_file_name_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = TiledInputPart::new(&input, 0); let result = tiled_input_part.file_name(); assert_eq!(&*SRC_IMAGE_PATH, &result); } #[test] fn test_tiledinputpart_header_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = TiledInputPart::new(&input, 0); let header = tiled_input_part.header(); header.sanity_check(true, false).unwrap(); } #[test] fn test_tiledinputpart_version_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let version = tiled_input_part.version(); assert_eq!(version.is_tiled(), true); } #[test] fn test_tiledinputpart_set_frame_buffer_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let mut tiled_input_part = super::TiledInputPart::new(&input, 0); let frame_buffer = FrameBuffer::new(); tiled_input_part.set_frame_buffer(&frame_buffer).unwrap(); } #[test] fn test_tiledinputpart_frame_buffer_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let _ = tiled_input_part.frame_buffer(); } #[test] fn test_tiledinputpart_is_complete_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let is_complete = tiled_input_part.is_complete(); assert_eq!(is_complete, true); } #[test] fn test_tiledinputpart_tile_x_size_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let tile_x_size = tiled_input_part.tile_x_size(); assert_eq!(tile_x_size, 64); } #[test] fn test_tiledinputpart_tile_y_size_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let tile_y_size = tiled_input_part.tile_y_size(); assert_eq!(tile_y_size, 64); } #[test] fn test_tiledinputpart_level_mode_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let level_mode = tiled_input_part.level_mode(); assert_eq!(level_mode, LevelMode::OneLevel); } #[test] fn test_tiledinputpart_level_rounding_mode_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let level_rounding_mode = tiled_input_part.level_rounding_mode(); assert_eq!(level_rounding_mode, LevelRoundingMode::RoundDown); } #[test] fn test_tiledinputpart_num_levels_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let num_levels = tiled_input_part.num_levels().unwrap(); assert_eq!(num_levels, 1); } #[test] fn test_tiledinputpart_num_x_levels_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let num_x_levels = tiled_input_part.num_x_levels(); assert_eq!(num_x_levels, 1); } #[test] fn test_tiledinputpart_num_y_levels_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let num_y_levels = tiled_input_part.num_y_levels(); assert_eq!(num_y_levels, 1); } #[test] fn test_tiledinputpart_is_valid_level_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let is_valid_level = tiled_input_part.is_valid_level(0, 0); assert_eq!(is_valid_level, true); } #[test] fn test_tiledinputpart_is_valid_level_failure_invalid_level() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let is_valid_level = tiled_input_part.is_valid_level(100, 100); assert_eq!(is_valid_level, false); } #[test] fn test_tiledinputpart_level_width_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let level_width = tiled_input_part.level_width(0).unwrap(); assert_eq!(level_width, 1200); } #[test] #[should_panic] fn test_tiledinputpart_level_width_failure_invalid_level() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part.level_width(i32::MIN).unwrap(); } #[test] fn test_tiledinputpart_level_height_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let level_height = tiled_input_part.level_height(0).unwrap(); assert_eq!(level_height, 800); } #[test] #[should_panic] fn test_tiledinputpart_level_height_failure_invalid_level() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part.level_height(i32::MIN).unwrap(); } #[test] fn test_tiledinputpart_num_x_tiles_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let num_x_tiles = tiled_input_part.num_x_tiles(0).unwrap(); assert_eq!(num_x_tiles, 19); } #[test] #[should_panic] fn test_tiledinputpart_num_x_tiles_failed_invalid_level() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part.num_x_tiles(i32::MIN).unwrap(); } #[test] fn test_tiledinputpart_num_y_tiles_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let num_y_tiles = tiled_input_part.num_y_tiles(0).unwrap(); assert_eq!(num_y_tiles, 13); } #[test] #[should_panic] fn test_tiledinputpart_num_y_tiles_failed_invalid_level() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part.num_y_tiles(i32::MIN).unwrap(); } #[test] fn test_tiledinputpart_data_window_for_level_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let data_window_for_level: [i32; 4] = tiled_input_part.data_window_for_level(0, 0).unwrap(); assert_eq!(data_window_for_level, [0, 0, 1199, 799]); } #[test] #[should_panic] fn test_tiledinputpart_data_window_for_level_failure_invalid_level() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part .data_window_for_level::<[i32; 4]>(i32::MIN, i32::MIN) .unwrap(); } #[test] fn test_tiledinputpart_data_window_for_tile_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); let data_window_for_tile: [i32; 4] = tiled_input_part.data_window_for_tile(0, 0, 0, 0).unwrap(); assert_eq!(data_window_for_tile, [0, 0, 63, 63]); } #[test] #[should_panic] fn test_tiledinputpart_data_window_for_tile_failure_invalid_level() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part .data_window_for_tile::<[i32; 4]>( i32::MIN, i32::MIN, i32::MIN, i32::MIN, ) .unwrap(); } #[test] fn test_tiledinputpart_read_tile_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let mut tiled_input_part = super::TiledInputPart::new(&input, 0); let frame_buffer = FrameBuffer::new(); tiled_input_part.set_frame_buffer(&frame_buffer).unwrap(); tiled_input_part.read_tile(0, 0, 0, 0).unwrap(); } #[test] #[should_panic] fn test_tiledinputpart_read_tile_failure_invalid_level_and_frame_buffer() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let mut tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part .read_tile(i32::MIN, i32::MIN, i32::MIN, i32::MIN) .unwrap(); } #[test] fn test_tiledinputpart_read_tiles_success() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let mut tiled_input_part = super::TiledInputPart::new(&input, 0); let frame_buffer = FrameBuffer::new(); tiled_input_part.set_frame_buffer(&frame_buffer).unwrap(); tiled_input_part.read_tiles(0, 0, 0, 0, 0, 0).unwrap(); } #[test] #[should_panic] fn test_tiledinputpart_read_tiles_failure_invalid_level_and_frame_buffer() { let input = MultiPartInputFile::new(&*SRC_IMAGE_PATH, 0, true).unwrap(); let mut tiled_input_part = super::TiledInputPart::new(&input, 0); tiled_input_part .read_tiles( i32::MIN, i32::MIN, i32::MIN, i32::MIN, i32::MIN, i32::MIN, ) .unwrap(); } }
use pickledb::error::ErrorType; use pickledb::{PickleDb, PickleDbDumpPolicy}; #[macro_use(matches)] extern crate matches; extern crate fs2; use fs2::FileExt; use std::fs::File; mod common; #[test] fn load_serialization_error_test() { set_test_rsc!("json_db.db"); // create a new DB with Json serialization let mut db = PickleDb::new_json("json_db.db", PickleDbDumpPolicy::AutoDump); // set some values db.set("num", &100).unwrap(); db.set("float", &1.1).unwrap(); db.set("string", &String::from("my string")).unwrap(); db.set("vec", &vec![1, 2, 3]).unwrap(); // try to load the same DB with Bincode serialization, should fail let load_as_bin = PickleDb::load_bin("json_db.db", PickleDbDumpPolicy::NeverDump); assert!(load_as_bin.is_err()); let load_as_bin_err = load_as_bin.err().unwrap(); assert!(matches!( load_as_bin_err.get_type(), ErrorType::Serialization )); assert_eq!(load_as_bin_err.to_string(), "Cannot deserialize DB"); // try to load the same DB with CBOR serialization, should fail let load_as_cbor = PickleDb::load_cbor("json_db.db", PickleDbDumpPolicy::NeverDump); assert!(load_as_cbor.is_err()); let load_as_cbor_err = load_as_cbor.err().unwrap(); assert!(matches!( load_as_cbor_err.get_type(), ErrorType::Serialization )); assert_eq!(load_as_cbor_err.to_string(), "Cannot deserialize DB"); // try to load the same DB with Yaml serialization, should not fail because YAML is // a superset oj JSON assert!(PickleDb::load_yaml("json_db.db", PickleDbDumpPolicy::NeverDump).is_ok()); } #[test] fn load_error_test() { // load a file that doesn't exist and make sure we get an IO error let load_result = PickleDb::load_bin("doesnt_exists.db", PickleDbDumpPolicy::NeverDump); assert!(load_result.is_err()); let load_result_err = load_result.err().unwrap(); assert!(matches!(load_result_err.get_type(), ErrorType::Io)); } #[allow(clippy::cognitive_complexity)] #[test] fn dump_error_test() { set_test_rsc!("dump_error_test.db"); // I didn't find a way to effectively lock a file for writing on OS's // other than Windows. So until I find a solution I'm bypassing the test // for non-Windows OS's if cfg!(not(target_os = "windows")) { return; } // create a new DB with Json serialization let mut db = PickleDb::new_json("dump_error_test.db", PickleDbDumpPolicy::AutoDump); // set some values db.set("num", &100).unwrap(); db.set("float", &1.1).unwrap(); db.set("string", &String::from("my string")).unwrap(); db.set("vec", &vec![1, 2, 3]).unwrap(); db.lcreate("list1").unwrap().lextend(&[1, 2, 3]); // lock the DB file so no more writes will be possible let db_file = File::open("dump_error_test.db").unwrap(); db_file.lock_exclusive().unwrap(); // try set, confirm failure let try_set = db.set("num", &200); assert!(try_set.is_err()); let try_set_err = try_set.err().unwrap(); assert!(matches!(try_set_err.get_type(), ErrorType::Io)); // verify the old value is still there assert_eq!(db.get::<i32>("num").unwrap(), 100); // try dump, confirm failure let try_dump = db.dump(); assert!(try_dump.is_err()); let try_dump_err = try_dump.err().unwrap(); assert!(matches!(try_dump_err.get_type(), ErrorType::Io)); // try rem, confirm failure let try_rem = db.rem("num"); assert!(try_rem.is_err()); let try_rem_err = try_rem.err().unwrap(); assert!(matches!(try_rem_err.get_type(), ErrorType::Io)); // verify "num" is still in the DB assert_eq!(db.get::<i32>("num").unwrap(), 100); // try lcreate, confirm failure let try_lcreate = db.lcreate("list2"); assert!(try_lcreate.is_err()); let try_lcreate_err = try_lcreate.err().unwrap(); assert!(matches!(try_lcreate_err.get_type(), ErrorType::Io)); // try ladd, confirm failure let try_ladd = db.ladd("list1", &100); assert!(try_ladd.is_none()); // confirm list size is still the same assert_eq!(db.llen("list1"), 3); // try lextend, confirm failure let try_lextend = db.lextend("list1", &["aa", "bb"]); assert!(try_lextend.is_none()); // confirm list size is still the same assert_eq!(db.llen("list1"), 3); // try lrem_list, confirm failure let try_lrem_list = db.lrem_list("list1"); assert!(try_lrem_list.is_err()); let try_lrem_list_err = try_lrem_list.err().unwrap(); assert!(matches!(try_lrem_list_err.get_type(), ErrorType::Io)); // verify "list1" is still in the DB assert!(db.exists("list1")); // try lpop, confirm failure let try_lpop = db.lpop::<i32>("list1", 0); assert!(try_lpop.is_none()); // confirm list size is still the same assert_eq!(db.llen("list1"), 3); // try lrem_value, confirm failure let try_lrem_value = db.lrem_value("list1", &1); assert!(try_lrem_value.is_err()); let try_lrem_value_err = try_lrem_value.err().unwrap(); assert!(matches!(try_lrem_value_err.get_type(), ErrorType::Io)); // verify "list1" is still in the DB assert_eq!(db.llen("list1"), 3); // unlock the file db_file.unlock().unwrap(); }
fn main() { let stdin = std::io::stdin(); let mut rd = ProconReader::new(stdin.lock()); let n: usize = rd.get(); let dd: Vec<(usize, usize)> = (0..n) .map(|_| { let d1: usize = rd.get(); let d2: usize = rd.get(); (d1, d2) }) .collect(); let found = dd.windows(3).any(|x| { let (d, e, f) = (x[0], x[1], x[2]); d.0 == d.1 && e.0 == e.1 && f.0 == f.1 }); println!("{}", if found { "Yes" } else { "No" }); } pub struct ProconReader<R: std::io::Read> { reader: R, } impl<R: std::io::Read> ProconReader<R> { pub fn new(reader: R) -> Self { Self { reader } } pub fn get<T: std::str::FromStr>(&mut self) -> T { use std::io::Read; let buf = self .reader .by_ref() .bytes() .map(|b| b.unwrap()) .skip_while(|&byte| byte == b' ' || byte == b'\n' || byte == b'\r') .take_while(|&byte| byte != b' ' && byte != b'\n' && byte != b'\r') .collect::<Vec<_>>(); std::str::from_utf8(&buf) .unwrap() .parse() .ok() .expect("Parse Error.") } }
use proc_macro2::TokenStream; use crate::utils::*; pub(crate) const NAME: &[&str] = &["Transpose"]; // Implementing this with `Into` requires many type annotations. pub(crate) fn derive(data: &Data, items: &mut Vec<ItemImpl>) -> Result<()> { check_fields(data)?; items.push(transpose_option(data)?); items.push(transpose_result(data)?); items.push(transpose_ok(data)?); items.push(transpose_err(data)?); Ok(()) } fn check_fields(data: &Data) -> Result<()> { let generics = data.generics(); let fields = data.fields(); let comma = if generics.params.empty_or_trailing() { quote!(,) } else { TokenStream::new() }; if quote!(#generics).to_string() == quote!(<#(#fields),*#comma>).to_string() { Ok(()) } else { Err(error!(data.span, "all fields need to be generics")) } } fn transpose_option(data: &Data) -> Result<ItemImpl> { let ident = data.ident(); let fields = data.fields(); let mut items = data.impl_with_capacity(1)?; let ty_generics = fields.iter().map(|f| quote!(::core::option::Option<#f>)); *items.self_ty() = parse_quote!(#ident<#(#ty_generics),*>)?; let transpose = data.variants().iter().map(|v| quote!(#ident::#v(x) => x.map(#ident::#v))); items.push_item(parse_quote! { #[inline] fn transpose(self) -> ::core::option::Option<#ident<#(#fields),*>> { match self { #(#transpose,)* } } }?); Ok(items.build_item()) } fn transpose_result(data: &Data) -> Result<ItemImpl> { let fields = data.fields(); let mut items = data.impl_with_capacity(1)?; let err_fields: &Vec<_> = &(0..fields.len()) .map(|i| { let id = format_ident!("__E{}", i); items.push_generic_param(param_ident!("{}", id)); id }) .collect(); let ident = data.ident(); let ty_generics = fields.iter().zip(err_fields.iter()).map(|(f, ef)| quote!(::core::result::Result<#f, #ef>)); *items.self_ty() = parse_quote!(#ident<#(#ty_generics),*>)?; let transpose = data .variants() .iter() .map(|v| quote!(#ident::#v(x) => x.map(#ident::#v).map_err(#ident::#v))); items.push_item(parse_quote! { #[inline] fn transpose(self) -> ::core::result::Result<#ident<#(#fields),*>, #ident<#(#err_fields),*>> { match self { #(#transpose,)* } } }?); Ok(items.build_item()) } fn transpose_ok(data: &Data) -> Result<ItemImpl> { let ident = data.ident(); let fields = data.fields(); let mut items = data.impl_with_capacity(1)?; items.push_generic_param(param_ident!("__E")); let ty_generics = fields.iter().map(|f| quote!(::core::result::Result<#f, __E>)); *items.self_ty() = parse_quote!(#ident<#(#ty_generics),*>)?; let transpose = data.variants().iter().map(|v| quote!(#ident::#v(x) => x.map(#ident::#v))); items.push_item(parse_quote! { #[inline] fn transpose_ok(self) -> ::core::result::Result<#ident<#(#fields),*>, __E> { match self { #(#transpose,)* } } }?); Ok(items.build_item()) } fn transpose_err(data: &Data) -> Result<ItemImpl> { let ident = data.ident(); let fields = data.fields(); let mut items = data.impl_with_capacity(1)?; items.push_generic_param(param_ident!("__T")); let ty_generics = fields.iter().map(|f| quote!(::core::result::Result<__T, #f>)); *items.self_ty() = parse_quote!(#ident<#(#ty_generics),*>)?; let transpose = data.variants().iter().map(|v| quote!(#ident::#v(x) => x.map_err(#ident::#v))); items.push_item(parse_quote! { #[inline] fn transpose_err(self) -> ::core::result::Result<__T, #ident<#(#fields),*>> { match self { #(#transpose,)* } } }?); Ok(items.build_item()) }
//! Defines types required at exploration runtime. mod integer_domain; mod integer_set; mod range; use proc_macro2::TokenStream; use quote::quote; /// Returns the token stream defining the runtime. pub fn get() -> TokenStream { let range = range::get(); let integer_set = integer_set::get(); let integer_domain = integer_domain::get(); quote! { pub trait Domain: Copy + Eq { /// Indicates if the domain is empty. fn is_failed(&self) -> bool; /// Indicates if the domain contains a single alternative. fn is_constrained(&self) -> bool; /// Indicates if the domain contains another. fn contains(&self, other: Self) -> bool; /// Restricts the domain to the intersection with `other`. fn restrict(&mut self, other: Self); /// Indicates if the domain has an alternatve in common with `other`. fn intersects(&self, mut other: Self) -> bool where Self: Sized { other.restrict(*self); !other.is_failed() } /// Indicates if the domain is equal to another domain. fn is(&self, mut other: Self) -> Trivalent where Self: Sized { other.restrict(*self); if other.is_failed() { Trivalent::False } else if other == *self { Trivalent::True } else { Trivalent::Maybe } } } #range #integer_set #integer_domain } }
use proc_macro2::TokenStream as TokenStream2; use quote::{quote_spanned, ToTokens}; use as_derive_utils::gen_params_in::InWhat; use crate::sabi_trait::{TokenizerParams, WhichSelf, WithAssocTys}; /// Generates the code that delegates the implementation of the traits /// to the wrapped DynTrait or RObject. pub(super) fn delegated_impls( TokenizerParams { arenas: _, ctokens, totrait_def, trait_to, trait_backend, trait_interface, lt_tokens, .. }: TokenizerParams<'_>, mod_: &mut TokenStream2, ) { let where_preds = &totrait_def.where_preds; let impls = totrait_def.trait_flags; let spans = &totrait_def.trait_spans; // let gen_params_deser_header= // totrait_def.generics_tokenizer( // InWhat::ImplHeader, // WithAssocTys::Yes(WhichSelf::NoSelf), // &lt_tokens.lt_de_erasedptr, // ); let gen_params_header = totrait_def.generics_tokenizer( InWhat::ImplHeader, WithAssocTys::Yes(WhichSelf::NoSelf), &lt_tokens.lt_erasedptr, ); let gen_params_use_to = totrait_def.generics_tokenizer( InWhat::ItemUse, WithAssocTys::Yes(WhichSelf::NoSelf), &lt_tokens.lt_erasedptr, ); let gen_params_use_to_static = totrait_def.generics_tokenizer( InWhat::ItemUse, WithAssocTys::Yes(WhichSelf::NoSelf), &lt_tokens.staticlt_erasedptr, ); let trait_interface_header = totrait_def.generics_tokenizer( InWhat::ImplHeader, WithAssocTys::Yes(WhichSelf::NoSelf), &lt_tokens.lt, ); let trait_interface_use = totrait_def.generics_tokenizer( InWhat::ItemUse, WithAssocTys::Yes(WhichSelf::NoSelf), &ctokens.ts_empty, ); if impls.debug { let where_preds = where_preds.into_iter(); quote_spanned!(spans.debug=> impl<#gen_params_header> std::fmt::Debug for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* { #[inline] fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ std::fmt::Debug::fmt(&self.obj,f) } } ) .to_tokens(mod_); } if impls.display { let where_preds = where_preds.into_iter(); quote_spanned!(spans.display=> impl<#gen_params_header> std::fmt::Display for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* { #[inline] fn fmt(&self,f:&mut std::fmt::Formatter<'_>)->std::fmt::Result{ std::fmt::Display::fmt(&self.obj,f) } } ) .to_tokens(mod_); } if impls.error { let where_preds = where_preds.into_iter(); quote_spanned!(spans.error=> impl<#gen_params_header> std::error::Error for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* {} ) .to_tokens(mod_); } if impls.clone { let where_preds = where_preds.into_iter(); quote_spanned!(spans.clone=> impl<#gen_params_header> std::clone::Clone for #trait_to<#gen_params_use_to> where #trait_backend<#gen_params_use_to>:Clone, _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* { #[inline] fn clone(&self)->Self{ Self{ obj:std::clone::Clone::clone(&self.obj), _marker:__sabi_re::UnsafeIgnoredType::DEFAULT, } } } ) .to_tokens(mod_); } if impls.hash { let where_preds = where_preds.into_iter(); quote_spanned!(spans.hash=> impl<#gen_params_header> std::hash::Hash for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* { #[inline] fn hash<H>(&self, state: &mut H) where H: std::hash::Hasher { std::hash::Hash::hash(&self.obj,state) } } ) .to_tokens(mod_); } if impls.send { let where_preds = where_preds.into_iter(); quote_spanned!(spans.send=> unsafe impl<#gen_params_header> std::marker::Send for #trait_to<#gen_params_use_to> where _ErasedPtr:__GetPointerKind, #(#where_preds,)* {} ) .to_tokens(mod_); } if impls.sync { let where_preds = where_preds.into_iter(); quote_spanned!(spans.sync=> unsafe impl<#gen_params_header> std::marker::Sync for #trait_to<#gen_params_use_to> where _ErasedPtr:__GetPointerKind, #(#where_preds,)* {} ) .to_tokens(mod_); } if impls.fmt_write { let where_preds = where_preds.into_iter(); quote_spanned!(spans.fmt_write=> impl<#gen_params_header> std::fmt::Write for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsMutPtr<PtrTarget=()>, #(#where_preds,)* { #[inline] fn write_str(&mut self, s: &str) -> Result<(), std::fmt::Error>{ std::fmt::Write::write_str(&mut self.obj,s) } } ) .to_tokens(mod_); } if impls.io_write { let where_preds = where_preds.into_iter(); quote_spanned!(spans.io_write=> impl<#gen_params_header> std::io::Write for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsMutPtr<PtrTarget=()>, #(#where_preds,)* { fn write(&mut self, buf: &[u8]) -> std::io::Result<usize>{ std::io::Write::write(&mut self.obj,buf) } fn flush(&mut self) -> std::io::Result<()>{ std::io::Write::flush(&mut self.obj) } fn write_all(&mut self, buf: &[u8]) -> std::io::Result<()> { std::io::Write::write_all(&mut self.obj,buf) } } ) .to_tokens(mod_); } if impls.io_read { let where_preds = where_preds.into_iter(); quote_spanned!(spans.io_read=> impl<#gen_params_header> std::io::Read for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsMutPtr<PtrTarget=()>, #(#where_preds,)* { fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize>{ std::io::Read::read(&mut self.obj,buf) } fn read_exact(&mut self, buf: &mut [u8]) -> std::io::Result<()> { std::io::Read::read_exact(&mut self.obj,buf) } } ) .to_tokens(mod_); } if impls.io_buf_read { let where_preds = where_preds.into_iter(); quote_spanned!(spans.io_buf_read=> impl<#gen_params_header> std::io::BufRead for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsMutPtr<PtrTarget=()>, #(#where_preds,)* { fn fill_buf(&mut self) -> std::io::Result<&[u8]>{ std::io::BufRead::fill_buf(&mut self.obj) } fn consume(&mut self, amount:usize ){ std::io::BufRead::consume(&mut self.obj,amount) } } ) .to_tokens(mod_); } if impls.io_seek { let where_preds = where_preds.into_iter(); quote_spanned!(spans.io_seek=> impl<#gen_params_header> std::io::Seek for #trait_to<#gen_params_use_to> where _ErasedPtr:__sabi_re::AsMutPtr<PtrTarget=()>, #(#where_preds,)* { fn seek(&mut self, pos: std::io::SeekFrom) -> std::io::Result<u64>{ std::io::Seek::seek(&mut self.obj,pos) } } ) .to_tokens(mod_); } let gen_params_header_and2 = totrait_def.generics_tokenizer( InWhat::ImplHeader, WithAssocTys::Yes(WhichSelf::NoSelf), &ctokens.ts_erasedptr_and2, ); let gen_params_use_2 = totrait_def.generics_tokenizer( InWhat::ItemUse, WithAssocTys::Yes(WhichSelf::NoSelf), &lt_tokens.staticlt_erasedptr2, ); if impls.eq { let where_preds = where_preds.into_iter(); quote_spanned!(spans.eq=> #[allow(clippy::extra_unused_lifetimes)] impl<#gen_params_header> std::cmp::Eq for #trait_to<#gen_params_use_to_static> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* {} ) .to_tokens(mod_); } if impls.partial_eq { let where_preds = where_preds.into_iter(); quote_spanned!(spans.partial_eq=> #[allow(clippy::extra_unused_lifetimes)] impl<#gen_params_header_and2> std::cmp::PartialEq<#trait_to<#gen_params_use_2>> for #trait_to<#gen_params_use_to_static> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, _ErasedPtr2:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* { fn eq(&self,other:&#trait_to<#gen_params_use_2>)->bool{ std::cmp::PartialEq::eq( &self.obj, &other.obj ) } } ) .to_tokens(mod_); } if impls.ord { let where_preds = where_preds.into_iter(); quote_spanned!(spans.ord=> #[allow(clippy::extra_unused_lifetimes)] impl<#gen_params_header> std::cmp::Ord for #trait_to<#gen_params_use_to_static> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* { fn cmp(&self,other:&Self)->std::cmp::Ordering{ std::cmp::Ord::cmp( &self.obj, &other.obj ) } } ) .to_tokens(mod_); } if impls.partial_ord { let where_preds = where_preds.into_iter(); quote_spanned!(spans.partial_ord=> #[allow(clippy::extra_unused_lifetimes)] impl<#gen_params_header_and2> std::cmp::PartialOrd<#trait_to<#gen_params_use_2>> for #trait_to<#gen_params_use_to_static> where _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, _ErasedPtr2:__sabi_re::AsPtr<PtrTarget=()>, #(#where_preds,)* { fn partial_cmp( &self, other:&#trait_to<#gen_params_use_2> )->Option<std::cmp::Ordering> { std::cmp::PartialOrd::partial_cmp( &self.obj, &other.obj ) } } ) .to_tokens(mod_); } // if let Some(deserialize_bound)=&totrait_def.deserialize_bound { // let deserialize_path=&deserialize_bound.bound.path; // let lifetimes=deserialize_bound.bound.lifetimes.as_ref() // .map(|x|ToTokenFnMut::new(move|ts|{ // for lt in &x.lifetimes { // lt.to_tokens(ts); // Comma::default().to_tokens(ts); // } // })); // let suffix=&lt_tokens.lt_erasedptr; // let header_generics=arenas.alloc(quote!( #lifetimes #suffix )); // let gen_params_header= // totrait_def.generics_tokenizer( // InWhat::ImplHeader, // WithAssocTys::Yes(WhichSelf::NoSelf), // header_generics, // ); // let lifetime_param=deserialize_bound.lifetime; // quote!( // impl<#gen_params_header> #deserialize_path for #trait_to<#gen_params_use_to> // where // #trait_backend<#gen_params_use_to>: #deserialize_path, // _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, // #(#where_preds,)* // { // fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> // where // D: ::serde::Deserializer<#lifetime_param>, // { // #trait_backend::<#gen_params_use_to>::deserialize(deserializer) // .map(Self::from_sabi) // } // } // ).to_tokens(mod_); // } // if impls.serialize{ // quote!( // impl<#gen_params_header> ::serde::Serialize for #trait_to<#gen_params_use_to> // where // #trait_backend<#gen_params_use_to>: ::serde::Serialize, // _ErasedPtr:__sabi_re::AsPtr<PtrTarget=()>, // #(#where_preds,)* // { // fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> // where // S: ::serde::Serializer, // { // self.obj.serialize(serializer) // } // } // ).to_tokens(mod_); // } if let Some(iter_item) = &totrait_def.iterator_item { let one_lt = &lt_tokens.one_lt; quote_spanned!(spans.iterator=> impl<#trait_interface_header> abi_stable::erased_types::IteratorItem<#one_lt> for #trait_interface<#trait_interface_use> where #iter_item:#one_lt { type Item=#iter_item; } ) .to_tokens(mod_); } if impls.iterator { quote_spanned!(spans.iterator=> impl<#gen_params_header> std::iter::Iterator for #trait_to<#gen_params_use_to> where _ErasedPtr:__GetPointerKind, #trait_backend<#gen_params_use_to>:std::iter::Iterator, { type Item=<#trait_backend<#gen_params_use_to>as std::iter::Iterator>::Item; fn next(&mut self)->Option<Self::Item>{ self.obj.next() } fn nth(&mut self,nth:usize)->Option<Self::Item>{ self.obj.nth(nth) } fn size_hint(&self)->(usize,Option<usize>){ self.obj.size_hint() } fn count(self)->usize{ self.obj.count() } fn last(self)->Option<Self::Item>{ self.obj.last() } } ) .to_tokens(mod_); } if impls.double_ended_iterator { quote_spanned!(spans.double_ended_iterator=> impl<#gen_params_header> std::iter::DoubleEndedIterator for #trait_to<#gen_params_use_to> where _ErasedPtr:__GetPointerKind, #trait_backend<#gen_params_use_to>:std::iter::DoubleEndedIterator, { fn next_back(&mut self)->Option<Self::Item>{ self.obj.next_back() } } ) .to_tokens(mod_); } }
use assert_cmd::Command; use predicates::prelude::*; use std::fs; /// Compare contents of test file with `stdout` fn run(args: &[&str], file_name: &str) -> Result<(), Box<dyn std::error::Error>> { let expected = fs::read_to_string(file_name)?; Command::cargo_bin("rust-cat")? .args(args) .assert() .success() .stdout(expected); Ok(()) } #[test] fn no_args() -> Result<(), Box<dyn std::error::Error>> { Command::cargo_bin("rust-cat")? .assert() .failure() .stderr(predicate::str::contains("Usage:")); Ok(()) } #[test] fn file_not_found() -> Result<(), Box<dyn std::error::Error>> { Command::cargo_bin("rust-cat")? .arg("somewhere/does/exist") .assert() .success() .stderr(predicate::str::contains("No such file or directory")); Ok(()) } #[test] fn one_file_without_arg() -> Result<(), Box<dyn std::error::Error>> { run(&["Cargo.toml"], "tests/expected/one_file_without_arg.txt") } #[test] fn two_file_without_arg() -> Result<(), Box<dyn std::error::Error>> { run( &["Cargo.toml", "Cargo.toml"], "tests/expected/two_file_without_arg.txt", ) } #[test] fn one_file_with_arg_n() -> Result<(), Box<dyn std::error::Error>> { run( &["-n", "Cargo.toml"], "tests/expected/one_file_with_arg_n.txt", ) } #[test] fn one_file_with_arg_b() -> Result<(), Box<dyn std::error::Error>> { run( &["-b", "Cargo.toml"], "tests/expected/one_file_with_arg_b.txt", ) } #[test] fn two_file_with_arg_n() -> Result<(), Box<dyn std::error::Error>> { run( &["-n", "Cargo.toml", "Cargo.toml"], "tests/expected/two_file_with_arg_n.txt", ) } #[test] fn two_file_with_arg_b() -> Result<(), Box<dyn std::error::Error>> { run( &["-b", "Cargo.toml", "Cargo.toml"], "tests/expected/two_file_with_arg_b.txt", ) } #[test] fn one_file_with_arg_n_and_b() -> Result<(), Box<dyn std::error::Error>> { Command::cargo_bin("rust-cat")? .arg("-n") .arg("-b") .arg("Cargo.toml") .assert() .failure() .stderr(predicate::str::contains( "error: The argument '--number-nonblank' cannot be used with '--number'", )); Ok(()) }
impl Solution { pub fn num_identical_pairs(nums: Vec<i32>) -> i32 { let mut cnt = vec![0; 101]; for i in 0..nums.len() { cnt[nums[i] as usize] += 1; } let mut ans = 0; for i in 1..101 { ans += (cnt[i] * (cnt[i] - 1)) / 2; } ans } }
#[doc = r"Value read from the register"] pub struct R { bits: u32, } #[doc = r"Value to write to the register"] pub struct W { bits: u32, } impl super::CC { #[doc = r"Modifies the contents of the register"] #[inline(always)] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); self.register.set(f(&R { bits }, &mut W { bits }).bits); } #[doc = r"Reads the contents of the register"] #[inline(always)] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r"Writes to the register"] #[inline(always)] pub fn write<F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { self.register.set( f(&mut W { bits: Self::reset_value(), }) .bits, ); } #[doc = r"Reset value of the register"] #[inline(always)] pub const fn reset_value() -> u32 { 0 } #[doc = r"Writes the reset value to the register"] #[inline(always)] pub fn reset(&self) { self.register.set(Self::reset_value()) } } #[doc = "Possible values of the field `ADC_CC_CS`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ADC_CC_CSR { #[doc = "PLL VCO divided by CLKDIV"] ADC_CC_CS_SYSPLL, #[doc = "PIOSC"] ADC_CC_CS_PIOSC, #[doc = "MOSC"] ADC_CC_CS_MOSC, #[doc = r"Reserved"] _Reserved(u8), } impl ADC_CC_CSR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bits(&self) -> u8 { match *self { ADC_CC_CSR::ADC_CC_CS_SYSPLL => 0, ADC_CC_CSR::ADC_CC_CS_PIOSC => 1, ADC_CC_CSR::ADC_CC_CS_MOSC => 2, ADC_CC_CSR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline(always)] pub fn _from(value: u8) -> ADC_CC_CSR { match value { 0 => ADC_CC_CSR::ADC_CC_CS_SYSPLL, 1 => ADC_CC_CSR::ADC_CC_CS_PIOSC, 2 => ADC_CC_CSR::ADC_CC_CS_MOSC, i => ADC_CC_CSR::_Reserved(i), } } #[doc = "Checks if the value of the field is `ADC_CC_CS_SYSPLL`"] #[inline(always)] pub fn is_adc_cc_cs_syspll(&self) -> bool { *self == ADC_CC_CSR::ADC_CC_CS_SYSPLL } #[doc = "Checks if the value of the field is `ADC_CC_CS_PIOSC`"] #[inline(always)] pub fn is_adc_cc_cs_piosc(&self) -> bool { *self == ADC_CC_CSR::ADC_CC_CS_PIOSC } #[doc = "Checks if the value of the field is `ADC_CC_CS_MOSC`"] #[inline(always)] pub fn is_adc_cc_cs_mosc(&self) -> bool { *self == ADC_CC_CSR::ADC_CC_CS_MOSC } } #[doc = "Values that can be written to the field `ADC_CC_CS`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ADC_CC_CSW { #[doc = "PLL VCO divided by CLKDIV"] ADC_CC_CS_SYSPLL, #[doc = "PIOSC"] ADC_CC_CS_PIOSC, #[doc = "MOSC"] ADC_CC_CS_MOSC, } impl ADC_CC_CSW { #[allow(missing_docs)] #[doc(hidden)] #[inline(always)] pub fn _bits(&self) -> u8 { match *self { ADC_CC_CSW::ADC_CC_CS_SYSPLL => 0, ADC_CC_CSW::ADC_CC_CS_PIOSC => 1, ADC_CC_CSW::ADC_CC_CS_MOSC => 2, } } } #[doc = r"Proxy"] pub struct _ADC_CC_CSW<'a> { w: &'a mut W, } impl<'a> _ADC_CC_CSW<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: ADC_CC_CSW) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = "PLL VCO divided by CLKDIV"] #[inline(always)] pub fn adc_cc_cs_syspll(self) -> &'a mut W { self.variant(ADC_CC_CSW::ADC_CC_CS_SYSPLL) } #[doc = "PIOSC"] #[inline(always)] pub fn adc_cc_cs_piosc(self) -> &'a mut W { self.variant(ADC_CC_CSW::ADC_CC_CS_PIOSC) } #[doc = "MOSC"] #[inline(always)] pub fn adc_cc_cs_mosc(self) -> &'a mut W { self.variant(ADC_CC_CSW::ADC_CC_CS_MOSC) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits &= !(15 << 0); self.w.bits |= ((value as u32) & 15) << 0; self.w } } #[doc = r"Value of the field"] pub struct ADC_CC_CLKDIVR { bits: u8, } impl ADC_CC_CLKDIVR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bits(&self) -> u8 { self.bits } } #[doc = r"Proxy"] pub struct _ADC_CC_CLKDIVW<'a> { w: &'a mut W, } impl<'a> _ADC_CC_CLKDIVW<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits &= !(63 << 4); self.w.bits |= ((value as u32) & 63) << 4; self.w } } impl R { #[doc = r"Value of the register as raw bits"] #[inline(always)] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bits 0:3 - ADC Clock Source"] #[inline(always)] pub fn adc_cc_cs(&self) -> ADC_CC_CSR { ADC_CC_CSR::_from(((self.bits >> 0) & 15) as u8) } #[doc = "Bits 4:9 - PLL VCO Clock Divisor"] #[inline(always)] pub fn adc_cc_clkdiv(&self) -> ADC_CC_CLKDIVR { let bits = ((self.bits >> 4) & 63) as u8; ADC_CC_CLKDIVR { bits } } } impl W { #[doc = r"Writes raw bits to the register"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.bits = bits; self } #[doc = "Bits 0:3 - ADC Clock Source"] #[inline(always)] pub fn adc_cc_cs(&mut self) -> _ADC_CC_CSW { _ADC_CC_CSW { w: self } } #[doc = "Bits 4:9 - PLL VCO Clock Divisor"] #[inline(always)] pub fn adc_cc_clkdiv(&mut self) -> _ADC_CC_CLKDIVW { _ADC_CC_CLKDIVW { w: self } } }
// Copyright 2017 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // See the License for the specific language governing permissions and // limitations under the License. use std::sync::{Arc, mpsc}; use tikv::raftstore::store::{keys, Peekable, SnapManager, create_event_loop, bootstrap_store}; use tikv::server::Node; use tikv::storage::ALL_CFS; use tikv::util::rocksdb; use tempdir::TempDir; use kvproto::metapb; use kvproto::raft_serverpb::RegionLocalState; use super::pd::{TestPdClient, bootstrap_with_first_region}; use super::cluster::{Cluster, Simulator}; use super::node::{ChannelTransport, new_node_cluster}; use super::transport_simulate::SimulateTransport; use super::util::*; fn test_bootstrap_idempotent<T: Simulator>(cluster: &mut Cluster<T>) { // assume that there is a node bootstrap the cluster and add region in pd successfully cluster.add_first_region().unwrap(); // now at same time start the another node, and will recive cluster is not bootstrap // it will try to bootstrap with a new region, but will failed // the region number still 1 cluster.start(); cluster.check_regions_number(1); cluster.shutdown(); sleep_ms(500); cluster.start(); cluster.check_regions_number(1); } #[test] fn test_node_bootstrap_with_prepared_data() { // create a node let pd_client = Arc::new(TestPdClient::new(0)); let cfg = new_server_config(0); let mut event_loop = create_event_loop(&cfg.raft_store).unwrap(); let simulate_trans = SimulateTransport::new(ChannelTransport::new()); let tmp_engine = TempDir::new("test_cluster").unwrap(); let engine = Arc::new(rocksdb::new_engine(tmp_engine.path().to_str().unwrap(), ALL_CFS) .unwrap()); let tmp_mgr = TempDir::new("test_cluster").unwrap(); let mut node = Node::new(&mut event_loop, &cfg, pd_client.clone()); let snap_mgr = SnapManager::new(tmp_mgr.path().to_str().unwrap(), Some(node.get_sendch()), cfg.raft_store.use_sst_file_snapshot); let (_, snapshot_status_receiver) = mpsc::channel(); // assume there is a node has bootstrapped the cluster and add region in pd successfully bootstrap_with_first_region(pd_client.clone()).unwrap(); // now anthoer node at same time begin bootstrap node, but panic after prepared bootstrap // now rocksDB must have some prepare data bootstrap_store(&engine, 0, 1).unwrap(); let region = node.prepare_bootstrap_cluster(&engine, 1).unwrap(); assert!(engine.get_msg::<metapb::Region>(&keys::prepare_bootstrap_key()) .unwrap() .is_some()); let region_state_key = keys::region_state_key(region.get_id()); assert!(engine.get_msg::<RegionLocalState>(&region_state_key).unwrap().is_some()); // try to restart this node, will clear the prepare data node.start(event_loop, engine.clone(), simulate_trans, snap_mgr, snapshot_status_receiver) .unwrap(); assert!(engine.clone() .get_msg::<metapb::Region>(&keys::prepare_bootstrap_key()) .unwrap() .is_none()); assert!(engine.get_msg::<RegionLocalState>(&region_state_key).unwrap().is_none()); assert_eq!(pd_client.get_regions_number() as u32, 1); node.stop().unwrap(); } #[test] fn test_node_bootstrap_idempotent() { let mut cluster = new_node_cluster(0, 3); test_bootstrap_idempotent(&mut cluster); }
use super::io::*; use super::board::*; use super::minimax::*; pub trait Player { fn get_move(&self, mut board: Board) -> usize; fn get_token(&self) -> usize; } pub struct CpuPlayer { token: usize } impl CpuPlayer { pub fn new(token: usize) -> CpuPlayer { CpuPlayer { token: token } } } impl Player for CpuPlayer { fn get_move(&self, mut board: Board) -> usize { let chosen_space = match minimax(board).0 { Ok(space) => space, Err(e) => panic!(e), }; chosen_space } fn get_token(&self) -> usize { self.token } } pub struct HumanPlayer<I: Io> { io: I, token: usize } impl<I: Io> HumanPlayer<I> { pub fn new(io: I, token: usize) -> HumanPlayer<I> { HumanPlayer { io: io, token: token } } } impl<I: Io> Player for HumanPlayer<I> { fn get_move(&self, mut board: Board) -> usize { self.io.print(board.render_as_string() + "\n"); let response = self.io.prompt("Enter move: ".to_string()); let space: Option<usize> = response.trim().parse(); if space.is_some() && board.space_is_playable(space.unwrap() - 1) { space.unwrap() - 1 } else { self.io.print("Bad move!\n".to_string()); self.get_move(board) } } fn get_token(&self) -> usize { self.token } }
use std::marker::PhantomData; use ocl::{self, builders::KernelBuilder}; use crate::{Pack, Push, Context}; /// Device buffer of abstract entities. Entity should implement `Pack`. pub struct InstanceBuffer<T: Pack + 'static> { buffer_int: ocl::Buffer<i32>, buffer_float: ocl::Buffer<f32>, count: usize, phantom: PhantomData<T>, } impl<T: Pack> InstanceBuffer<T> { pub fn new<'a, I: ExactSizeIterator<Item=&'a T>>(context: &Context, objects: I) -> crate::Result<Self> { let mut buffer = Self::reserved(context, objects.len())?; buffer.write(objects)?; Ok(buffer) } pub fn reserved(context: &Context, count: usize) -> crate::Result<Self> { let buffer_int = ocl::Buffer::<i32>::builder() .queue(context.queue().clone()) .flags(ocl::flags::MEM_READ_ONLY) .len((T::size_int()*count).max(1)) .fill_val(0 as i32) .build()?; let buffer_float = ocl::Buffer::<f32>::builder() .queue(context.queue().clone()) .flags(ocl::flags::MEM_READ_ONLY) .len((T::size_float()*count).max(1)) .fill_val(0 as f32) .build()?; Ok(Self { buffer_int, buffer_float, count, phantom: PhantomData::<T>, }) } pub fn write<'a, I: ExactSizeIterator<Item=&'a T>>(&mut self, objects: I) -> crate::Result<()> { let len = objects.len(); let mut buffer_int = vec![0i32; T::size_int().max(1)*len]; let mut buffer_float = vec![0.0f32; T::size_float().max(1)*len]; // Use this `.max(1)` workaround because `chunks` panics on 0 (why there is such silly requirement?) for (obj, (ibuf, fbuf)) in objects.zip( buffer_int.chunks_mut(Self::size_int().max(1)) .zip(buffer_float.chunks_mut(Self::size_float().max(1))) ) { obj.pack_to(&mut ibuf[..T::size_int()], &mut fbuf[..T::size_float()]); } if len == 0 || T::size_int() == 0 { buffer_int = vec![0]; } if len == 0 || T::size_float() == 0 { buffer_float = vec![0.0]; } if buffer_int.len() == self.buffer_int.len() && buffer_float.len() == self.buffer_float.len() { self.buffer_int.cmd() .offset(0) .write(&buffer_int) .enq()?; self.buffer_float.cmd() .offset(0) .write(&buffer_float) .enq()?; Ok(()) } else { Err("buffers size mismatch".into()) } } pub fn buffer_int(&self) -> &ocl::Buffer<i32> { &self.buffer_int } pub fn buffer_float(&self) -> &ocl::Buffer<f32> { &self.buffer_float } pub fn size_int() -> usize { T::size_int() } pub fn size_float() -> usize { T::size_float() } pub fn count(&self) -> usize { self.count } } impl<T: Pack> Push for InstanceBuffer<T> { fn args_count() -> usize { 3 } fn args_def(kb: &mut KernelBuilder) { kb .arg(None::<&ocl::Buffer<i32>>) // int buffer .arg(None::<&ocl::Buffer<f32>>) // float buffer .arg(0i32); // instance count } fn args_set(&mut self, i: usize, k: &mut ocl::Kernel) -> crate::Result<()> { k.set_arg(i + 0, self.buffer_int())?; k.set_arg(i + 1, self.buffer_float())?; k.set_arg(i + 2, self.count() as i32)?; Ok(()) } }
// Copyright 2021 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use common_exception::Result; use common_expression::types::DataType; use common_expression::types::NumberScalar; use common_expression::Scalar; use crate::optimizer::rule::Rule; use crate::optimizer::rule::RuleID; use crate::optimizer::rule::TransformResult; use crate::optimizer::RelExpr; use crate::optimizer::SExpr; use crate::plans::Aggregate; use crate::plans::AggregateMode; use crate::plans::ConstantExpr; use crate::plans::DummyTableScan; use crate::plans::EvalScalar; use crate::plans::PatternPlan; use crate::plans::RelOp; use crate::plans::ScalarExpr; /// Fold simple `COUNT(*)` aggregate with statistics information. pub struct RuleFoldCountAggregate { id: RuleID, pattern: SExpr, } impl RuleFoldCountAggregate { pub fn new() -> Self { Self { id: RuleID::FoldCountAggregate, // Aggregate // \ // * pattern: SExpr::create_unary( PatternPlan { plan_type: RelOp::Aggregate, } .into(), SExpr::create_leaf( PatternPlan { plan_type: RelOp::Pattern, } .into(), ), ), } } } impl Rule for RuleFoldCountAggregate { fn id(&self) -> RuleID { self.id } fn apply(&self, s_expr: &SExpr, state: &mut TransformResult) -> Result<()> { let agg: Aggregate = s_expr.plan().clone().try_into()?; if agg.mode == AggregateMode::Final || agg.mode == AggregateMode::Partial { return Ok(()); } let rel_expr = RelExpr::with_s_expr(s_expr); let input_prop = rel_expr.derive_relational_prop_child(0)?; let is_simple_count = agg.group_items.is_empty() && agg.aggregate_functions.iter().all(|agg| match &agg.scalar { ScalarExpr::AggregateFunction(agg_func) => { agg_func.func_name == "count" && (agg_func.args.is_empty() || !matches!( agg_func.args[0].data_type(), Ok(DataType::Nullable(_)) | Ok(DataType::Null) )) && !agg_func.distinct } _ => false, }); let simple_nullable_count = agg.group_items.is_empty() && agg.aggregate_functions.iter().all(|agg| match &agg.scalar { ScalarExpr::AggregateFunction(agg_func) => { agg_func.func_name == "count" && (agg_func.args.is_empty() || matches!(agg_func.args[0].data_type(), Ok(DataType::Nullable(_)))) && !agg_func.distinct } _ => false, }); if let (true, Some(card)) = (is_simple_count, input_prop.statistics.precise_cardinality) { let mut scalars = agg.aggregate_functions; for item in scalars.iter_mut() { item.scalar = ScalarExpr::ConstantExpr(ConstantExpr { span: item.scalar.span(), value: Scalar::Number(NumberScalar::UInt64(card)), }); } let eval_scalar = EvalScalar { items: scalars }; let dummy_table_scan = DummyTableScan; state.add_result(SExpr::create_unary( eval_scalar.into(), SExpr::create_leaf(dummy_table_scan.into()), )); } else if let (true, true, column_stats, Some(table_card)) = ( simple_nullable_count, input_prop.statistics.is_accurate, input_prop.statistics.column_stats, input_prop.statistics.precise_cardinality, ) { let mut scalars = agg.aggregate_functions; for item in scalars.iter_mut() { if let ScalarExpr::AggregateFunction(agg_func) = item.scalar.clone() { if agg_func.args.is_empty() { item.scalar = ScalarExpr::ConstantExpr(ConstantExpr { span: item.scalar.span(), value: Scalar::Number(NumberScalar::UInt64(table_card)), }); return Ok(()); } else { let col_set = agg_func.args[0].used_columns(); for index in col_set { let col_stat = column_stats.get(&index); if let Some(card) = col_stat { item.scalar = ScalarExpr::ConstantExpr(ConstantExpr { span: item.scalar.span(), value: Scalar::Number(NumberScalar::UInt64( table_card - card.null_count, )), }); } else { return Ok(()); } } } } } let eval_scalar = EvalScalar { items: scalars }; let dummy_table_scan = DummyTableScan; state.add_result(SExpr::create_unary( eval_scalar.into(), SExpr::create_leaf(dummy_table_scan.into()), )); } Ok(()) } fn pattern(&self) -> &SExpr { &self.pattern } }
use chrono::Duration; use itertools::Itertools; use serde::Deserialize; use serde_with::{serde_as, CommaSeparator, DisplayFromStr, DurationSeconds, StringWithSeparator}; // <item name="drinkCanEmpty"> // <property name="HoldType" value="14"/> // <property name="Meshfile" value="#Other/Items?Food/can_emptyPrefab.prefab"/> // <property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/> // <property name="Material" value="Mmetal"/> // <property name="Stacknumber" value="500"/> // <property name="EconomicValue" value="5"/> // <property name="CraftingIngredientTime" value="9"/> // <property name="Group" value="Resources"/> // </item> // TODO: not sure properties can be parsed with serde_xml_rs 🤔 #[derive(Debug, Deserialize)] pub struct Property { #[serde(default)] pub name: Option<String>, #[serde(default)] pub value: Option<String>, } #[derive(Debug, Deserialize)] pub struct Item { #[serde(default)] pub name: Option<String>, #[serde(rename = "property", default)] pub properties: Vec<Property>, } #[derive(Debug, Deserialize)] pub struct ItemsFile { #[serde(rename = "$value")] pub items: Vec<Item>, }
use std::mem; #[derive(Debug)] pub struct RecordingTimestamp(i64); impl RecordingTimestamp { // // new // #[cfg(target_os = "windows")] #[inline] pub fn now() -> Self { // https://docs.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps // https://docs.rs/winapi/0.3.9/winapi/um/profileapi/fn.QueryPerformanceCounter.html // https://www.youtube.com/watch?v=tAcUIEoy2Yk use winapi::{ um::winnt::LARGE_INTEGER, um::profileapi::QueryPerformanceCounter, }; let time = unsafe { let mut count: LARGE_INTEGER = mem::zeroed(); // TODO: Remove this initialization QueryPerformanceCounter(&mut count); mem::transmute::<_, i64>(count) }; Self(time) } #[cfg(not(target_os = "windows"))] #[inline] pub fn now() -> i64 { (OffsetDateTime::now_utc() - OffsetDateTime::unix_epoch()).whole_nanoseconds() as i64 } // // to_nanoseconds // #[cfg(target_os = "windows")] #[inline] pub fn to_nanoseconds(&self) -> i128 { use winapi::{ um::winnt::LARGE_INTEGER, um::profileapi::QueryPerformanceFrequency, }; let frequency = unsafe { let mut frequency: LARGE_INTEGER = mem::zeroed(); // TODO: Remove this initialization QueryPerformanceFrequency(&mut frequency); mem::transmute::<_, i64>(frequency) }; 1_000_000_000 * self.0 as i128 / frequency as i128 } #[cfg(not(target_os = "windows"))] #[inline] pub fn to_nanoseconds(&self) -> i128 { self.0 as i128 } }
// auto generated, do not modify. // created: Mon Feb 22 23:57:02 2016 // src-file: /QtCore/qflags.h // dst-file: /src/core/qflags.rs // // header block begin => #![feature(libc)] #![feature(core)] #![feature(collections)] extern crate libc; use self::libc::*; // <= header block end // main block begin => // <= main block end // use block begin => use std::ops::Deref; // <= use block end // ext block begin => // #[link(name = "Qt5Core")] // #[link(name = "Qt5Gui")] // #[link(name = "Qt5Widgets")] // #[link(name = "QtInline")] extern { fn QIncompatibleFlag_Class_Size() -> c_int; // proto: void QIncompatibleFlag::QIncompatibleFlag(int i); fn C_ZN17QIncompatibleFlagC2Ei(arg0: c_int) -> u64; fn QFlag_Class_Size() -> c_int; // proto: void QFlag::QFlag(ushort ai); fn C_ZN5QFlagC2Et(arg0: c_ushort) -> u64; // proto: void QFlag::QFlag(int ai); fn C_ZN5QFlagC2Ei(arg0: c_int) -> u64; // proto: void QFlag::QFlag(short ai); fn C_ZN5QFlagC2Es(arg0: c_short) -> u64; // proto: void QFlag::QFlag(uint ai); fn C_ZN5QFlagC2Ej(arg0: c_uint) -> u64; } // <= ext block end // body block begin => // class sizeof(QIncompatibleFlag)=4 #[derive(Default)] pub struct QIncompatibleFlag { // qbase: None, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QFlag)=4 #[derive(Default)] pub struct QFlag { // qbase: None, pub qclsinst: u64 /* *mut c_void*/, } impl /*struct*/ QIncompatibleFlag { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QIncompatibleFlag { return QIncompatibleFlag{qclsinst: qthis, ..Default::default()}; } } // proto: void QIncompatibleFlag::QIncompatibleFlag(int i); impl /*struct*/ QIncompatibleFlag { pub fn new<T: QIncompatibleFlag_new>(value: T) -> QIncompatibleFlag { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QIncompatibleFlag_new { fn new(self) -> QIncompatibleFlag; } // proto: void QIncompatibleFlag::QIncompatibleFlag(int i); impl<'a> /*trait*/ QIncompatibleFlag_new for (i32) { fn new(self) -> QIncompatibleFlag { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QIncompatibleFlagC2Ei()}; let ctysz: c_int = unsafe{QIncompatibleFlag_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self as c_int; let qthis: u64 = unsafe {C_ZN17QIncompatibleFlagC2Ei(arg0)}; let rsthis = QIncompatibleFlag{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } impl /*struct*/ QFlag { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QFlag { return QFlag{qclsinst: qthis, ..Default::default()}; } } // proto: void QFlag::QFlag(ushort ai); impl /*struct*/ QFlag { pub fn new<T: QFlag_new>(value: T) -> QFlag { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QFlag_new { fn new(self) -> QFlag; } // proto: void QFlag::QFlag(ushort ai); impl<'a> /*trait*/ QFlag_new for (u16) { fn new(self) -> QFlag { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN5QFlagC2Et()}; let ctysz: c_int = unsafe{QFlag_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self as c_ushort; let qthis: u64 = unsafe {C_ZN5QFlagC2Et(arg0)}; let rsthis = QFlag{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QFlag::QFlag(int ai); impl<'a> /*trait*/ QFlag_new for (i32) { fn new(self) -> QFlag { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN5QFlagC2Ei()}; let ctysz: c_int = unsafe{QFlag_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self as c_int; let qthis: u64 = unsafe {C_ZN5QFlagC2Ei(arg0)}; let rsthis = QFlag{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QFlag::QFlag(short ai); impl<'a> /*trait*/ QFlag_new for (i16) { fn new(self) -> QFlag { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN5QFlagC2Es()}; let ctysz: c_int = unsafe{QFlag_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self as c_short; let qthis: u64 = unsafe {C_ZN5QFlagC2Es(arg0)}; let rsthis = QFlag{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QFlag::QFlag(uint ai); impl<'a> /*trait*/ QFlag_new for (u32) { fn new(self) -> QFlag { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN5QFlagC2Ej()}; let ctysz: c_int = unsafe{QFlag_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self as c_uint; let qthis: u64 = unsafe {C_ZN5QFlagC2Ej(arg0)}; let rsthis = QFlag{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // <= body block end
use proc_macro2; use proc_macro2::Span; use syn; use field::*; use meta::path_to_string; use model::*; use util::*; use crate::meta::MetaItem; pub fn derive(item: syn::DeriveInput) -> Result<proc_macro2::TokenStream, Diagnostic> { let treat_none_as_default_value = MetaItem::with_name(&item.attrs, "diesel") .map(|meta| { meta.warn_if_other_options(&["treat_none_as_default_value"]); meta.required_nested_item("treat_none_as_default_value") .map(|m| m.expect_bool_value()) }) .unwrap_or(Ok(true))?; let model = Model::from_item(&item)?; if model.fields().is_empty() { return Err(Span::call_site() .error("Cannot derive Insertable for unit structs") .help(format!( "Use `insert_into({}::table).default_values()` if you want `DEFAULT VALUES`", path_to_string(&model.table_name()) ))); } let table_name = &model.table_name(); let struct_name = &item.ident; let (_, ty_generics, where_clause) = item.generics.split_for_impl(); let mut impl_generics = item.generics.clone(); impl_generics.params.push(parse_quote!('insert)); let (impl_generics, ..) = impl_generics.split_for_impl(); let mut generate_borrowed_insert = true; let mut direct_field_ty = Vec::with_capacity(model.fields().len()); let mut direct_field_assign = Vec::with_capacity(model.fields().len()); let mut ref_field_ty = Vec::with_capacity(model.fields().len()); let mut ref_field_assign = Vec::with_capacity(model.fields().len()); for field in model.fields() { let serialize_as = field.ty_for_serialize()?; let embed = field.has_flag("embed"); match (serialize_as, embed) { (None, true) => { direct_field_ty.push(field_ty_embed(field, None)); direct_field_assign.push(field_expr_embed(field, None)); ref_field_ty.push(field_ty_embed(field, Some(quote!(&'insert)))); ref_field_assign.push(field_expr_embed(field, Some(quote!(&)))); } (None, false) => { direct_field_ty.push(field_ty( field, table_name, None, treat_none_as_default_value, )); direct_field_assign.push(field_expr( field, table_name, None, treat_none_as_default_value, )); ref_field_ty.push(field_ty( field, table_name, Some(quote!(&'insert)), treat_none_as_default_value, )); ref_field_assign.push(field_expr( field, table_name, Some(quote!(&)), treat_none_as_default_value, )); } (Some(ty), false) => { direct_field_ty.push(field_ty_serialize_as( field, table_name, &ty, treat_none_as_default_value, )); direct_field_assign.push(field_expr_serialize_as( field, table_name, &ty, treat_none_as_default_value, )); generate_borrowed_insert = false; // as soon as we hit one field with #[diesel(serialize_as)] there is no point in generating the impl of Insertable for borrowed structs } (Some(_), true) => { return Err(field .flags .span() .error("`#[diesel(embed)]` cannot be combined with `#[diesel(serialize_as)]`")) } } } let insert_owned = quote! { impl #impl_generics Insertable<#table_name::table> for #struct_name #ty_generics #where_clause { type Values = <(#(#direct_field_ty,)*) as Insertable<#table_name::table>>::Values; fn values(self) -> Self::Values { (#(#direct_field_assign,)*).values() } } }; let insert_borrowed = if generate_borrowed_insert { quote! { impl #impl_generics Insertable<#table_name::table> for &'insert #struct_name #ty_generics #where_clause { type Values = <(#(#ref_field_ty,)*) as Insertable<#table_name::table>>::Values; fn values(self) -> Self::Values { (#(#ref_field_assign,)*).values() } } } } else { quote! {} }; Ok(wrap_in_dummy_mod(quote! { use diesel::insertable::Insertable; use diesel::query_builder::UndecoratedInsertRecord; use diesel::prelude::*; #insert_owned #insert_borrowed impl #impl_generics UndecoratedInsertRecord<#table_name::table> for #struct_name #ty_generics #where_clause { } })) } fn field_ty_embed(field: &Field, lifetime: Option<proc_macro2::TokenStream>) -> syn::Type { let field_ty = &field.ty; parse_quote!(#lifetime #field_ty) } fn field_expr_embed(field: &Field, lifetime: Option<proc_macro2::TokenStream>) -> syn::Expr { let field_access = field.name.access(); parse_quote!(#lifetime self#field_access) } fn field_ty_serialize_as( field: &Field, table_name: &syn::Path, ty: &syn::Type, treat_none_as_default_value: bool, ) -> syn::Type { let column_name = field.column_name_ident(); if treat_none_as_default_value { let inner_ty = inner_of_option_ty(&ty); parse_quote!( std::option::Option<diesel::dsl::Eq< #table_name::#column_name, #inner_ty, >> ) } else { parse_quote!( diesel::dsl::Eq< #table_name::#column_name, #ty, > ) } } fn field_expr_serialize_as( field: &Field, table_name: &syn::Path, ty: &syn::Type, treat_none_as_default_value: bool, ) -> syn::Expr { let field_access = field.name.access(); let column_name = field.column_name_ident(); let column: syn::Expr = parse_quote!(#table_name::#column_name); if treat_none_as_default_value { if is_option_ty(&ty) { parse_quote!(self#field_access.map(|x| #column.eq(::std::convert::Into::<#ty>::into(x)))) } else { parse_quote!(std::option::Option::Some(#column.eq(::std::convert::Into::<#ty>::into(self#field_access)))) } } else { parse_quote!(#column.eq(::std::convert::Into::<#ty>::into(self#field_access))) } } fn field_ty( field: &Field, table_name: &syn::Path, lifetime: Option<proc_macro2::TokenStream>, treat_none_as_default_value: bool, ) -> syn::Type { let column_name = field.column_name_ident(); if treat_none_as_default_value { let inner_ty = inner_of_option_ty(&field.ty); parse_quote!( std::option::Option<diesel::dsl::Eq< #table_name::#column_name, #lifetime #inner_ty, >> ) } else { let inner_ty = &field.ty; parse_quote!( diesel::dsl::Eq< #table_name::#column_name, #lifetime #inner_ty, > ) } } fn field_expr( field: &Field, table_name: &syn::Path, lifetime: Option<proc_macro2::TokenStream>, treat_none_as_default_value: bool, ) -> syn::Expr { let field_access = field.name.access(); let column_name = field.column_name_ident(); let column: syn::Expr = parse_quote!(#table_name::#column_name); if treat_none_as_default_value { if is_option_ty(&field.ty) { if lifetime.is_some() { parse_quote!(self#field_access.as_ref().map(|x| #column.eq(x))) } else { parse_quote!(self#field_access.map(|x| #column.eq(x))) } } else { parse_quote!(std::option::Option::Some(#column.eq(#lifetime self#field_access))) } } else { parse_quote!(#column.eq(#lifetime self#field_access)) } }
use color_eyre::eyre::Result; use log::*; use minreq::get; use prettytable::{cell, row, Table}; use sha::{ sha1::Sha1, utils::{Digest, DigestExt, Reset}, }; use std::default::Default; fn check_haveibeenpwned(pass: &str) -> Result<String, minreq::Error> { let url = format!("https://api.pwnedpasswords.com/range/{}", pass); info!("Requesting to {}", url); let response = get(&url).send()?; response.as_str().map(|s| s.to_string()) } fn main() -> Result<()> { color_eyre::install()?; let mut args = std::env::args(); let _ = args.next(); // ignore command name if args.len() == 0 { eprintln!("no passwords given"); return Ok(()); } let mut table = Table::new(); table.add_row(row![br => "Password", "Times Found"]); let mut hash = Sha1::default(); while let Some(pass) = args.next() { debug!("finding {}", &pass); let password_hash = hash.digest(pass.as_bytes()).to_hex(); info!("hashed password {:?}", &password_hash); let hash_slice = password_hash[0..5].to_uppercase(); let hash_slice2 = password_hash[5..].to_uppercase(); info!("first chars of hashed password {:?}", hash_slice); if let Ok(response) = check_haveibeenpwned(&hash_slice) { if let Some(res) = response // .lines() .split("\r\n") .map(|line| { let line_split = line.split(':').collect::<Vec<&str>>(); (line_split[0], line_split[1]) }) .find(|(hash, _pass)| *hash == hash_slice2) { // println!("Found password {}, {} times", pass.to_uppercase(), res.1); table.add_row(row![br => pass.to_uppercase(), res.1]); } else { eprintln!("Password not found"); table.add_row(row![br => pass.to_uppercase(), 0]); } } hash.reset(); } table.printstd(); Ok(()) }
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::{ capability::*, model::{ self, addable_directory::{AddableDirectory, AddableDirectoryWithResult}, error::ModelError, hooks::*, }, }, cm_rust::ComponentDecl, directory_broker, fidl::endpoints::ServerEnd, fidl_fuchsia_io::{DirectoryProxy, NodeMarker, CLONE_FLAG_SAME_RIGHTS, MODE_TYPE_DIRECTORY}, fuchsia_async as fasync, fuchsia_vfs_pseudo_fs::{directory, file::simple::read_only}, fuchsia_zircon as zx, futures::{ future::{AbortHandle, Abortable, BoxFuture}, lock::Mutex, }, std::{collections::HashMap, sync::Arc}, }; struct HubCapabilityProvider { abs_moniker: model::AbsoluteMoniker, relative_path: Vec<String>, hub: Hub, } impl HubCapabilityProvider { pub fn new(abs_moniker: model::AbsoluteMoniker, relative_path: Vec<String>, hub: Hub) -> Self { HubCapabilityProvider { abs_moniker, relative_path, hub } } pub async fn open_async( &self, flags: u32, open_mode: u32, relative_path: String, server_end: zx::Channel, ) -> Result<(), ModelError> { let mut dir_path = self.relative_path.clone(); dir_path.append( &mut relative_path .split("/") .map(|s| s.to_string()) .filter(|s| !s.is_empty()) .collect::<Vec<String>>(), ); self.hub.inner.open(&self.abs_moniker, flags, open_mode, dir_path, server_end).await?; Ok(()) } } impl ComponentManagerCapabilityProvider for HubCapabilityProvider { fn open( &self, flags: u32, open_mode: u32, relative_path: String, server_chan: zx::Channel, ) -> BoxFuture<Result<(), ModelError>> { Box::pin(self.open_async(flags, open_mode, relative_path, server_chan)) } } /// Hub state on an instance of a component. struct Instance { pub abs_moniker: model::AbsoluteMoniker, pub component_url: String, pub execution: Option<Execution>, pub directory: directory::controlled::Controller<'static>, pub children_directory: directory::controlled::Controller<'static>, pub deleting_directory: directory::controlled::Controller<'static>, } /// The execution state for a component that has started running. struct Execution { pub resolved_url: String, pub directory: directory::controlled::Controller<'static>, } /// The Hub is a directory tree representing the component topology. Through the Hub, /// debugging and instrumentation tools can query information about component instances /// on the system, such as their component URLs, execution state and so on. /// /// Hub itself does not store any state locally other than a reference to `HubInner` /// where all the state and business logic resides. This enables Hub to be cloneable /// to be passed across tasks. #[derive(Clone)] pub struct Hub { inner: Arc<HubInner>, } impl Hub { /// Create a new Hub given a `component_url` and a controller to the root directory. pub fn new(component_url: String) -> Result<Self, ModelError> { Ok(Hub { inner: Arc::new(HubInner::new(component_url)?) }) } pub async fn open_root(&self, flags: u32, server_end: zx::Channel) -> Result<(), ModelError> { let root_moniker = model::AbsoluteMoniker::root(); self.inner.open(&root_moniker, flags, MODE_TYPE_DIRECTORY, vec![], server_end).await?; Ok(()) } pub fn hooks(&self) -> Vec<HookRegistration> { // List the hooks the Hub implements here. vec![ HookRegistration { event_type: EventType::AddDynamicChild, callback: self.inner.clone(), }, HookRegistration { event_type: EventType::PreDestroyInstance, callback: self.inner.clone(), }, HookRegistration { event_type: EventType::BindInstance, callback: self.inner.clone() }, HookRegistration { event_type: EventType::RouteFrameworkCapability, callback: self.inner.clone(), }, HookRegistration { event_type: EventType::StopInstance, callback: self.inner.clone() }, HookRegistration { event_type: EventType::PostDestroyInstance, callback: self.inner.clone(), }, ] } } pub struct HubInner { instances: Mutex<HashMap<model::AbsoluteMoniker, Instance>>, /// Called when Hub is dropped to drop pseudodirectory hosting the Hub. abort_handle: AbortHandle, } impl Drop for HubInner { fn drop(&mut self) { self.abort_handle.abort(); } } impl HubInner { /// Create a new Hub given a |component_url| and a controller to the root directory. pub fn new(component_url: String) -> Result<Self, ModelError> { let mut instances_map = HashMap::new(); let abs_moniker = model::AbsoluteMoniker::root(); let root_directory = HubInner::add_instance_if_necessary(&abs_moniker, component_url, &mut instances_map)? .expect("Did not create directory."); // Run the hub root directory forever until the component manager is terminated. let (abort_handle, abort_registration) = AbortHandle::new_pair(); let future = Abortable::new(root_directory, abort_registration); fasync::spawn(async move { let _ = future.await; }); Ok(HubInner { instances: Mutex::new(instances_map), abort_handle }) } pub async fn open( &self, abs_moniker: &model::AbsoluteMoniker, flags: u32, open_mode: u32, relative_path: Vec<String>, server_end: zx::Channel, ) -> Result<(), ModelError> { let instances_map = self.instances.lock().await; if !instances_map.contains_key(&abs_moniker) { let relative_path = relative_path.join("/"); return Err(ModelError::open_directory_error(abs_moniker.clone(), relative_path)); } instances_map[&abs_moniker] .directory .open_node( flags, open_mode, relative_path, ServerEnd::<NodeMarker>::new(server_end), &abs_moniker, ) .await?; Ok(()) } fn add_instance_if_necessary( abs_moniker: &model::AbsoluteMoniker, component_url: String, instance_map: &mut HashMap<model::AbsoluteMoniker, Instance>, ) -> Result<Option<directory::controlled::Controlled<'static>>, ModelError> { if instance_map.contains_key(&abs_moniker) { return Ok(None); } let (instance_controller, mut instance_controlled) = directory::controlled::controlled(directory::simple::empty()); // Add a 'url' file. instance_controlled.add_node( "url", { let url = component_url.clone(); read_only(move || Ok(url.clone().into_bytes())) }, &abs_moniker, )?; // Add an 'id' file. if let Some(child_moniker) = abs_moniker.leaf() { instance_controlled.add_node( "id", { let child_moniker = child_moniker.clone(); read_only(move || Ok(child_moniker.instance().to_string().into_bytes())) }, &abs_moniker, )?; } // Add a children directory. let (children_controller, children_controlled) = directory::controlled::controlled(directory::simple::empty()); instance_controlled.add_node("children", children_controlled, &abs_moniker)?; // Add a deleting directory. let (deleting_controller, deleting_controlled) = directory::controlled::controlled(directory::simple::empty()); instance_controlled.add_node("deleting", deleting_controlled, &abs_moniker)?; instance_map.insert( abs_moniker.clone(), Instance { abs_moniker: abs_moniker.clone(), component_url, execution: None, directory: instance_controller, children_directory: children_controller, deleting_directory: deleting_controller, }, ); Ok(Some(instance_controlled)) } async fn add_instance_to_parent_if_necessary<'a>( abs_moniker: &'a model::AbsoluteMoniker, component_url: String, mut instances_map: &'a mut HashMap<model::AbsoluteMoniker, Instance>, ) -> Result<(), ModelError> { if let Some(controlled) = HubInner::add_instance_if_necessary(&abs_moniker, component_url, &mut instances_map)? { if let (Some(leaf), Some(parent_moniker)) = (abs_moniker.leaf(), abs_moniker.parent()) { // In the children directory, the child's instance id is not used let partial_moniker = leaf.to_partial(); instances_map[&parent_moniker] .children_directory .add_node(partial_moniker.as_str(), controlled, &abs_moniker) .await?; } } Ok(()) } fn add_resolved_url_file( execution_directory: &mut directory::controlled::Controlled<'static>, resolved_url: String, abs_moniker: &model::AbsoluteMoniker, ) -> Result<(), ModelError> { execution_directory.add_node( "resolved_url", { read_only(move || Ok(resolved_url.clone().into_bytes())) }, &abs_moniker, )?; Ok(()) } fn add_in_directory( execution_directory: &mut directory::controlled::Controlled<'static>, component_decl: ComponentDecl, runtime: &model::Runtime, routing_facade: &model::RoutingFacade, abs_moniker: &model::AbsoluteMoniker, ) -> Result<(), ModelError> { let tree = model::DirTree::build_from_uses( routing_facade.route_use_fn_factory(), &abs_moniker, component_decl, )?; let mut in_dir = directory::simple::empty(); tree.install(&abs_moniker, &mut in_dir)?; let pkg_dir = runtime.namespace.as_ref().and_then(|n| n.package_dir.as_ref()); if let Some(pkg_dir) = Self::clone_dir(pkg_dir) { in_dir.add_node( "pkg", directory_broker::DirectoryBroker::from_directory_proxy(pkg_dir), &abs_moniker, )?; } execution_directory.add_node("in", in_dir, &abs_moniker)?; Ok(()) } fn add_expose_directory( execution_directory: &mut directory::controlled::Controlled<'static>, component_decl: ComponentDecl, routing_facade: &model::RoutingFacade, abs_moniker: &model::AbsoluteMoniker, ) -> Result<(), ModelError> { let tree = model::DirTree::build_from_exposes( routing_facade.route_expose_fn_factory(), &abs_moniker, component_decl, ); let mut expose_dir = directory::simple::empty(); tree.install(&abs_moniker, &mut expose_dir)?; execution_directory.add_node("expose", expose_dir, &abs_moniker)?; Ok(()) } fn add_out_directory( execution_directory: &mut directory::controlled::Controlled<'static>, runtime: &model::Runtime, abs_moniker: &model::AbsoluteMoniker, ) -> Result<(), ModelError> { if let Some(out_dir) = Self::clone_dir(runtime.outgoing_dir.as_ref()) { execution_directory.add_node( "out", directory_broker::DirectoryBroker::from_directory_proxy(out_dir), &abs_moniker, )?; } Ok(()) } fn add_runtime_directory( execution_directory: &mut directory::controlled::Controlled<'static>, runtime: &model::Runtime, abs_moniker: &model::AbsoluteMoniker, ) -> Result<(), ModelError> { if let Some(runtime_dir) = Self::clone_dir(runtime.runtime_dir.as_ref()) { execution_directory.add_node( "runtime", directory_broker::DirectoryBroker::from_directory_proxy(runtime_dir), &abs_moniker, )?; } Ok(()) } async fn on_bind_instance_async<'a>( &'a self, realm: Arc<model::Realm>, component_decl: &'a ComponentDecl, live_child_realms: &'a Vec<Arc<model::Realm>>, routing_facade: model::RoutingFacade, ) -> Result<(), ModelError> { let component_url = realm.component_url.clone(); let abs_moniker = realm.abs_moniker.clone(); let mut instances_map = self.instances.lock().await; Self::add_instance_to_parent_if_necessary(&abs_moniker, component_url, &mut instances_map) .await?; let instance = instances_map .get_mut(&abs_moniker) .expect(&format!("Unable to find instance {} in map.", abs_moniker)); // If we haven't already created an execution directory, create one now. if instance.execution.is_none() { let execution = realm.lock_execution().await; if let Some(runtime) = execution.runtime.as_ref() { let (execution_controller, mut execution_controlled) = directory::controlled::controlled(directory::simple::empty()); let exec = Execution { resolved_url: runtime.resolved_url.clone(), directory: execution_controller, }; instance.execution = Some(exec); Self::add_resolved_url_file( &mut execution_controlled, runtime.resolved_url.clone(), &abs_moniker, )?; Self::add_in_directory( &mut execution_controlled, component_decl.clone(), &runtime, &routing_facade, &abs_moniker, )?; Self::add_expose_directory( &mut execution_controlled, component_decl.clone(), &routing_facade, &abs_moniker, )?; Self::add_out_directory(&mut execution_controlled, runtime, &abs_moniker)?; Self::add_runtime_directory(&mut execution_controlled, runtime, &abs_moniker)?; instance.directory.add_node("exec", execution_controlled, &abs_moniker).await?; } } // TODO: Loop over deleting realms also? for child_realm in live_child_realms { Self::add_instance_to_parent_if_necessary( &child_realm.abs_moniker, child_realm.component_url.clone(), &mut instances_map, ) .await?; } Ok(()) } async fn on_add_dynamic_child_async(&self, realm: Arc<model::Realm>) -> Result<(), ModelError> { let mut instances_map = self.instances.lock().await; Self::add_instance_to_parent_if_necessary( &realm.abs_moniker, realm.component_url.clone(), &mut instances_map, ) .await?; Ok(()) } async fn on_post_destroy_instance_async( &self, realm: Arc<model::Realm>, ) -> Result<(), ModelError> { let mut instance_map = self.instances.lock().await; // TODO(xbhatnag): Investigate error handling scenarios here. // Can these errors arise from faulty components or from // a bug in ComponentManager? let parent_moniker = realm.abs_moniker.parent().expect("a root component cannot be dynamic"); let leaf = realm.abs_moniker.leaf().expect("a root component cannot be dynamic"); instance_map[&parent_moniker].deleting_directory.remove_node(leaf.as_str()).await?; instance_map .remove(&realm.abs_moniker) .expect("the dynamic component must exist in the instance map"); Ok(()) } async fn on_stop_instance_async(&self, realm: Arc<model::Realm>) -> Result<(), ModelError> { let mut instance_map = self.instances.lock().await; instance_map[&realm.abs_moniker].directory.remove_node("exec").await?; instance_map.get_mut(&realm.abs_moniker).expect("instance must exist").execution = None; Ok(()) } async fn on_pre_destroy_instance_async( &self, realm: Arc<model::Realm>, ) -> Result<(), ModelError> { let instance_map = self.instances.lock().await; let parent_moniker = realm.abs_moniker.parent().expect("A root component cannot be destroyed"); let leaf = realm.abs_moniker.leaf().expect("A root component cannot be destroyed"); // In the children directory, the child's instance id is not used let partial_moniker = leaf.to_partial(); let directory = instance_map[&parent_moniker] .children_directory .remove_node(partial_moniker.as_str()) .await? .ok_or(ModelError::remove_entry_error(leaf.as_str()))?; // In the deleting directory, the child's instance id is used instance_map[&parent_moniker] .deleting_directory .add_node(leaf.as_str(), directory, &realm.abs_moniker) .await?; Ok(()) } async fn on_route_framework_capability_async<'a>( self: Arc<Self>, realm: Arc<model::Realm>, capability: &'a ComponentManagerCapability, capability_provider: Option<Box<dyn ComponentManagerCapabilityProvider>>, ) -> Result<Option<Box<dyn ComponentManagerCapabilityProvider>>, ModelError> { // If this capability is not a directory, then it's not a hub capability. let mut relative_path = match (&capability_provider, capability) { (None, ComponentManagerCapability::Directory(source_path)) => source_path.split(), _ => return Ok(capability_provider), }; // If this capability's source path doesn't begin with 'hub', then it's // not a hub capability. if relative_path.is_empty() || relative_path.remove(0) != "hub" { return Ok(capability_provider); } Ok(Some(Box::new(HubCapabilityProvider::new( realm.abs_moniker.clone(), relative_path, Hub { inner: self.clone() }, )))) } // TODO(fsamuel): We should probably preserve the original error messages // instead of dropping them. fn clone_dir(dir: Option<&DirectoryProxy>) -> Option<DirectoryProxy> { dir.and_then(|d| io_util::clone_directory(d, CLONE_FLAG_SAME_RIGHTS).ok()) } } impl model::Hook for HubInner { fn on<'a>(self: Arc<Self>, event: &'a Event) -> BoxFuture<'a, Result<(), ModelError>> { Box::pin(async move { match event { Event::BindInstance { realm, component_decl, live_child_realms, routing_facade, } => { self.on_bind_instance_async( realm.clone(), component_decl, live_child_realms, routing_facade.clone(), ) .await?; } Event::AddDynamicChild { realm } => { self.on_add_dynamic_child_async(realm.clone()).await?; } Event::PreDestroyInstance { realm } => { self.on_pre_destroy_instance_async(realm.clone()).await?; } Event::StopInstance { realm } => { self.on_stop_instance_async(realm.clone()).await?; } Event::PostDestroyInstance { realm } => { self.on_post_destroy_instance_async(realm.clone()).await?; } Event::RouteFrameworkCapability { realm, capability, capability_provider } => { let mut capability_provider = capability_provider.lock().await; *capability_provider = self .on_route_framework_capability_async( realm.clone(), capability, capability_provider.take(), ) .await?; } _ => {} }; Ok(()) }) } } #[cfg(test)] mod tests { use { super::*, crate::model::{ self, hub::Hub, testing::mocks, testing::{ test_helpers::*, test_helpers::{dir_contains, list_directory, list_directory_recursive, read_file}, test_hook::HubInjectionTestHook, }, }, crate::startup, cm_rust::{ self, CapabilityPath, ChildDecl, ComponentDecl, ExposeDecl, ExposeDirectoryDecl, ExposeLegacyServiceDecl, ExposeSource, ExposeTarget, UseDecl, UseDirectoryDecl, UseLegacyServiceDecl, UseSource, }, fidl::endpoints::{ClientEnd, ServerEnd}, fidl_fuchsia_io::{ DirectoryMarker, DirectoryProxy, MODE_TYPE_DIRECTORY, OPEN_RIGHT_READABLE, OPEN_RIGHT_WRITABLE, }, fidl_fuchsia_sys2 as fsys, fuchsia_vfs_pseudo_fs::directory::entry::DirectoryEntry, fuchsia_zircon as zx, std::{convert::TryFrom, iter, path::Path}, }; /// Hosts an out directory with a 'foo' file. fn foo_out_dir_fn() -> Box<dyn Fn(ServerEnd<DirectoryMarker>) + Send + Sync> { Box::new(move |server_end: ServerEnd<DirectoryMarker>| { let mut out_dir = directory::simple::empty(); // Add a 'foo' file. out_dir .add_entry("foo", { read_only(move || Ok(b"bar".to_vec())) }) .map_err(|(s, _)| s) .expect("Failed to add 'foo' entry"); out_dir.open( OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, MODE_TYPE_DIRECTORY, &mut iter::empty(), ServerEnd::new(server_end.into_channel()), ); let mut test_dir = directory::simple::empty(); test_dir .add_entry("aaa", { read_only(move || Ok(b"bbb".to_vec())) }) .map_err(|(s, _)| s) .expect("Failed to add 'aaa' entry"); out_dir .add_entry("test", test_dir) .map_err(|(s, _)| s) .expect("Failed to add 'test' directory."); fasync::spawn(async move { let _ = out_dir.await; }); }) } /// Hosts a runtime directory with a 'bleep' file. fn bleep_runtime_dir_fn() -> Box<dyn Fn(ServerEnd<DirectoryMarker>) + Send + Sync> { Box::new(move |server_end: ServerEnd<DirectoryMarker>| { let mut pseudo_dir = directory::simple::empty(); // Add a 'bleep' file. pseudo_dir .add_entry("bleep", { read_only(move || Ok(b"blah".to_vec())) }) .map_err(|(s, _)| s) .expect("Failed to add 'bleep' entry"); pseudo_dir.open( OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, MODE_TYPE_DIRECTORY, &mut iter::empty(), ServerEnd::new(server_end.into_channel()), ); fasync::spawn(async move { let _ = pseudo_dir.await; }); }) } type DirectoryCallback = Box<dyn Fn(ServerEnd<DirectoryMarker>) + Send + Sync>; struct ComponentDescriptor { pub name: String, pub decl: ComponentDecl, pub host_fn: Option<DirectoryCallback>, pub runtime_host_fn: Option<DirectoryCallback>, } async fn start_component_manager_with_hub( root_component_url: String, components: Vec<ComponentDescriptor>, ) -> (Arc<model::Model>, Arc<Hub>, DirectoryProxy) { start_component_manager_with_hub_and_hooks(root_component_url, components, vec![]).await } async fn start_component_manager_with_hub_and_hooks( root_component_url: String, components: Vec<ComponentDescriptor>, additional_hooks: Vec<HookRegistration>, ) -> (Arc<model::Model>, Arc<Hub>, DirectoryProxy) { let resolved_root_component_url = format!("{}_resolved", root_component_url); let mut resolver = model::ResolverRegistry::new(); let mut runner = mocks::MockRunner::new(); let mut mock_resolver = mocks::MockResolver::new(); for component in components.into_iter() { mock_resolver.add_component(&component.name, component.decl); if let Some(host_fn) = component.host_fn { runner.host_fns.insert(resolved_root_component_url.clone(), host_fn); } if let Some(runtime_host_fn) = component.runtime_host_fn { runner .runtime_host_fns .insert(resolved_root_component_url.clone(), runtime_host_fn); } } resolver.register("test".to_string(), Box::new(mock_resolver)); let (client_chan, server_chan) = zx::Channel::create().unwrap(); let hub = Arc::new(Hub::new(root_component_url.clone()).unwrap()); hub.open_root(OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, server_chan.into()) .await .expect("Unable to open Hub root directory."); let startup_args = startup::Arguments { use_builtin_process_launcher: false, use_builtin_vmex: false, root_component_url: "".to_string(), }; let builtin_capabilities = Arc::new(startup::BuiltinRootCapabilities::new(&startup_args)); let model = Arc::new(model::Model::new(model::ModelParams { root_component_url, root_resolver_registry: resolver, elf_runner: Arc::new(runner), config: model::ModelConfig::default(), builtin_capabilities: builtin_capabilities.clone(), })); model.root_realm.hooks.install(builtin_capabilities.hooks()).await; model.root_realm.hooks.install(hub.hooks()).await; model.root_realm.hooks.install(additional_hooks).await; let res = model.look_up_and_bind_instance(model::AbsoluteMoniker::root()).await; let expected_res: Result<(), model::ModelError> = Ok(()); assert_eq!(format!("{:?}", res), format!("{:?}", expected_res)); let hub_proxy = ClientEnd::<DirectoryMarker>::new(client_chan) .into_proxy() .expect("failed to create directory proxy"); (model, hub, hub_proxy) } #[fuchsia_async::run_singlethreaded(test)] async fn hub_basic() { let root_component_url = "test:///root".to_string(); let (_model, _hub, hub_proxy) = start_component_manager_with_hub( root_component_url.clone(), vec![ ComponentDescriptor { name: "root".to_string(), decl: ComponentDecl { children: vec![ChildDecl { name: "a".to_string(), url: "test:///a".to_string(), startup: fsys::StartupMode::Lazy, }], ..default_component_decl() }, host_fn: None, runtime_host_fn: None, }, ComponentDescriptor { name: "a".to_string(), decl: ComponentDecl { children: vec![], ..default_component_decl() }, host_fn: None, runtime_host_fn: None, }, ], ) .await; assert_eq!(root_component_url, read_file(&hub_proxy, "url").await); assert_eq!( format!("{}_resolved", root_component_url), read_file(&hub_proxy, "exec/resolved_url").await ); assert_eq!("test:///a", read_file(&hub_proxy, "children/a/url").await); } #[fuchsia_async::run_singlethreaded(test)] async fn hub_out_directory() { let root_component_url = "test:///root".to_string(); let (_model, _hub, hub_proxy) = start_component_manager_with_hub( root_component_url.clone(), vec![ComponentDescriptor { name: "root".to_string(), decl: ComponentDecl { children: vec![ChildDecl { name: "a".to_string(), url: "test:///a".to_string(), startup: fsys::StartupMode::Lazy, }], ..default_component_decl() }, host_fn: Some(foo_out_dir_fn()), runtime_host_fn: None, }], ) .await; assert!(dir_contains(&hub_proxy, "exec", "out").await); assert!(dir_contains(&hub_proxy, "exec/out", "foo").await); assert!(dir_contains(&hub_proxy, "exec/out/test", "aaa").await); assert_eq!("bar", read_file(&hub_proxy, "exec/out/foo").await); assert_eq!("bbb", read_file(&hub_proxy, "exec/out/test/aaa").await); } #[fuchsia_async::run_singlethreaded(test)] async fn hub_runtime_directory() { let root_component_url = "test:///root".to_string(); let (_model, _hub, hub_proxy) = start_component_manager_with_hub( root_component_url.clone(), vec![ComponentDescriptor { name: "root".to_string(), decl: ComponentDecl { children: vec![ChildDecl { name: "a".to_string(), url: "test:///a".to_string(), startup: fsys::StartupMode::Lazy, }], ..default_component_decl() }, host_fn: None, runtime_host_fn: Some(bleep_runtime_dir_fn()), }], ) .await; assert_eq!("blah", read_file(&hub_proxy, "exec/runtime/bleep").await); } #[fuchsia_async::run_singlethreaded(test)] async fn hub_test_hook_interception() { let root_component_url = "test:///root".to_string(); let hub_injection_test_hook = Arc::new(HubInjectionTestHook::new()); let (_model, _hub, hub_proxy) = start_component_manager_with_hub_and_hooks( root_component_url.clone(), vec![ComponentDescriptor { name: "root".to_string(), decl: ComponentDecl { children: vec![ChildDecl { name: "a".to_string(), url: "test:///a".to_string(), startup: fsys::StartupMode::Lazy, }], uses: vec![UseDecl::Directory(UseDirectoryDecl { source: UseSource::Framework, source_path: CapabilityPath::try_from("/hub").unwrap(), target_path: CapabilityPath::try_from("/hub").unwrap(), })], ..default_component_decl() }, host_fn: None, runtime_host_fn: None, }], vec![HookRegistration { event_type: EventType::RouteFrameworkCapability, callback: hub_injection_test_hook.clone(), }], ) .await; let in_dir = io_util::open_directory( &hub_proxy, &Path::new("exec/in"), OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, ) .expect("Failed to open directory"); assert_eq!(vec!["hub"], list_directory(&in_dir).await); let scoped_hub_dir_proxy = io_util::open_directory( &hub_proxy, &Path::new("exec/in/hub"), OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, ) .expect("Failed to open directory"); // There are no out or runtime directories because there is no program running. assert_eq!(vec!["old_hub"], list_directory(&scoped_hub_dir_proxy).await); let old_hub_dir_proxy = io_util::open_directory( &hub_proxy, &Path::new("exec/in/hub/old_hub/exec"), OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, ) .expect("Failed to open directory"); // There are no out or runtime directories because there is no program running. assert_eq!(vec!["expose", "in", "resolved_url"], list_directory(&old_hub_dir_proxy).await); } #[fuchsia_async::run_singlethreaded(test)] async fn hub_in_directory() { let root_component_url = "test:///root".to_string(); let (_model, _hub, hub_proxy) = start_component_manager_with_hub( root_component_url.clone(), vec![ComponentDescriptor { name: "root".to_string(), decl: ComponentDecl { children: vec![ChildDecl { name: "a".to_string(), url: "test:///a".to_string(), startup: fsys::StartupMode::Lazy, }], uses: vec![ UseDecl::Directory(UseDirectoryDecl { source: UseSource::Framework, source_path: CapabilityPath::try_from("/hub/exec").unwrap(), target_path: CapabilityPath::try_from("/hub").unwrap(), }), UseDecl::LegacyService(UseLegacyServiceDecl { source: UseSource::Realm, source_path: CapabilityPath::try_from("/svc/baz").unwrap(), target_path: CapabilityPath::try_from("/svc/hippo").unwrap(), }), UseDecl::Directory(UseDirectoryDecl { source: UseSource::Realm, source_path: CapabilityPath::try_from("/data/foo").unwrap(), target_path: CapabilityPath::try_from("/data/bar").unwrap(), }), ], ..default_component_decl() }, host_fn: None, runtime_host_fn: None, }], ) .await; let in_dir = io_util::open_directory( &hub_proxy, &Path::new("exec/in"), OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, ) .expect("Failed to open directory"); assert_eq!(vec!["data", "hub", "svc"], list_directory(&in_dir).await); let scoped_hub_dir_proxy = io_util::open_directory( &hub_proxy, &Path::new("exec/in/hub"), OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, ) .expect("Failed to open directory"); // There are no out or runtime directories because there is no program running. assert_eq!( vec!["expose", "in", "resolved_url"], list_directory(&scoped_hub_dir_proxy).await ); } #[fuchsia_async::run_singlethreaded(test)] async fn hub_expose_directory() { let root_component_url = "test:///root".to_string(); let (_model, _hub, hub_proxy) = start_component_manager_with_hub( root_component_url.clone(), vec![ComponentDescriptor { name: "root".to_string(), decl: ComponentDecl { children: vec![ChildDecl { name: "a".to_string(), url: "test:///a".to_string(), startup: fsys::StartupMode::Lazy, }], exposes: vec![ ExposeDecl::LegacyService(ExposeLegacyServiceDecl { source: ExposeSource::Self_, source_path: CapabilityPath::try_from("/svc/foo").unwrap(), target_path: CapabilityPath::try_from("/svc/bar").unwrap(), target: ExposeTarget::Realm, }), ExposeDecl::Directory(ExposeDirectoryDecl { source: ExposeSource::Self_, source_path: CapabilityPath::try_from("/data/baz").unwrap(), target_path: CapabilityPath::try_from("/data/hippo").unwrap(), target: ExposeTarget::Realm, }), ], ..default_component_decl() }, host_fn: None, runtime_host_fn: None, }], ) .await; let expose_dir = io_util::open_directory( &hub_proxy, &Path::new("exec/expose"), OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, ) .expect("Failed to open directory"); assert_eq!(vec!["data/hippo", "svc/bar"], list_directory_recursive(&expose_dir).await); } }
use abi_stable::{ abi_stability::{ abi_checking::{check_layout_compatibility_with_globals, AbiInstability, CheckingGlobals}, extra_checks::{ ExtraChecks, ExtraChecksBox, ExtraChecksError, ExtraChecksRef, ForExtraChecksImplementor, StoredExtraChecks, TypeCheckerMut, }, stable_abi_trait::get_type_layout, }, const_utils::abs_sub_usize, external_types::ROnce, marker_type::UnsafeIgnoredType, sabi_trait::prelude::TD_Opaque, sabi_types::{CmpIgnored, Constructor}, std_types::*, type_layout::TypeLayout, utils::{self, leak_value}, GetStaticEquivalent, StableAbi, }; use std::{ fmt::{self, Display}, marker::PhantomData, mem::ManuallyDrop, ptr, }; use core_extensions::{matches, SelfOps}; #[cfg(not(miri))] fn check_subsets<F>(list: &[&'static TypeLayout], mut f: F) where F: FnMut(&[AbiInstability]), { let globals = CheckingGlobals::new(); for (l_i, l_abi) in list.iter().enumerate() { for (r_i, r_abi) in list.iter().enumerate() { let res = check_layout_compatibility_with_globals(l_abi, r_abi, &globals); if l_i <= r_i { assert_eq!(res, Ok(()), "\n\nl_i:{} r_i:{}\n\n", l_i, r_i); } else { if res.is_ok() { let _ = dbg!(l_i); let _ = dbg!(r_i); } let errs = res.unwrap_err().flatten_errors(); f(&*errs); } } } } const LAYOUT0: &TypeLayout = <WithConstant<V1_0> as StableAbi>::LAYOUT; const LAYOUT1: &TypeLayout = <WithConstant<V1_1> as StableAbi>::LAYOUT; const LAYOUT1B: &TypeLayout = <WithConstant<V1_1_Incompatible> as StableAbi>::LAYOUT; const LAYOUT2: &TypeLayout = <WithConstant<V1_2> as StableAbi>::LAYOUT; const LAYOUT3: &TypeLayout = <WithConstant<V1_3> as StableAbi>::LAYOUT; const LAYOUT3B: &TypeLayout = <WithConstant<V1_3_Incompatible> as StableAbi>::LAYOUT; #[test] fn test_subsets() { fn asserts(errs: &[AbiInstability]) { assert!(errs .iter() .any(|err| matches!(err, AbiInstability::ExtraCheckError { .. }))); } #[cfg(not(miri))] check_subsets(&[LAYOUT0, LAYOUT1, LAYOUT2, LAYOUT3], asserts); #[cfg(miri)] { let globals = CheckingGlobals::new(); assert_eq!( check_layout_compatibility_with_globals(LAYOUT0, LAYOUT0, &globals), Ok(()) ); asserts( &check_layout_compatibility_with_globals(LAYOUT1, LAYOUT0, &globals) .unwrap_err() .flatten_errors(), ); } } #[cfg(not(miri))] #[test] fn test_incompatible() { { let globals = CheckingGlobals::new(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT1, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT1B, &globals).unwrap_err(); check_layout_compatibility_with_globals(LAYOUT1B, LAYOUT1B, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT2, &globals).unwrap(); } { let globals = CheckingGlobals::new(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT2, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT1, &globals).unwrap(); } { let globals = CheckingGlobals::new(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT1B, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT2, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT2, &globals).unwrap_err(); } { let globals = CheckingGlobals::new(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT3, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT3B, &globals).unwrap_err(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT3B, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT3, &globals).unwrap_err(); check_layout_compatibility_with_globals(LAYOUT2, LAYOUT3, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT3, LAYOUT3B, &globals).unwrap_err(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT1, &globals).unwrap_err(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT2, &globals).unwrap_err(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT0, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT1, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT2, LAYOUT2, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT3, LAYOUT3, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT3B, LAYOUT3B, &globals).unwrap(); } } #[cfg(miri)] #[test] fn test_incompatible() { let globals = CheckingGlobals::new(); check_layout_compatibility_with_globals(LAYOUT0, LAYOUT1, &globals).unwrap(); check_layout_compatibility_with_globals(LAYOUT1, LAYOUT1B, &globals).unwrap_err(); } ////////////////////////////////////////////////////////////////////////////////// #[repr(C)] #[derive(abi_stable::StableAbi)] #[sabi( // Replaces the C:StableAbi constraint with `C:GetStaticEquivalent` // (a supertrait of StableAbi). not_stableabi(C), bound(C: GetConstant), extra_checks = Self::CHECKER, )] struct WithConstant<C> { // UnsafeIgnoredType is equivalent to PhantomData, // except that all `UnsafeIgnoredType` are considered the same type by `StableAbi`. _marker: UnsafeIgnoredType<C>, } impl<C> WithConstant<C> where C: GetConstant, { const CHECKER: ConstChecker = ConstChecker { chars: RStr::from_str(C::CHARS), }; } trait GetConstant { const CHARS: &'static str; } macro_rules! declare_consts { ( $( const $ty:ident = $slice:expr ; )* ) => ( $( #[derive(GetStaticEquivalent)] struct $ty; impl GetConstant for $ty{ const CHARS:&'static str=$slice; } )* ) } declare_consts! { const V1_0="ab"; const V1_1="abc"; const V1_1_Incompatible="abd"; const V1_2="abcd"; const V1_3="abcde"; const V1_3_Incompatible="abcdf"; } ///////////////////////////////////////// #[repr(C)] #[derive(Debug, Clone, StableAbi)] pub struct ConstChecker { chars: RStr<'static>, } impl Display for ConstChecker { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!( f, "ConstChecker: \ Checks that the associated constant for \ the other type is compatible with:\n{}\n.\ ", self.chars ) } } impl ConstChecker { fn check_compatible_inner(&self, other: &ConstChecker) -> Result<(), UnequalConstError> { if other.chars.starts_with(&*self.chars) { Ok(()) } else { Err(UnequalConstError { expected: self.chars, found: other.chars, }) } } } unsafe impl ExtraChecks for ConstChecker { fn type_layout(&self) -> &'static TypeLayout { <Self as StableAbi>::LAYOUT } fn check_compatibility( &self, _layout_containing_self: &'static TypeLayout, layout_containing_other: &'static TypeLayout, checker: TypeCheckerMut<'_>, ) -> RResult<(), ExtraChecksError> { Self::downcast_with_layout(layout_containing_other, checker, |other, _| { self.check_compatible_inner(other) }) } fn nested_type_layouts(&self) -> RCowSlice<'_, &'static TypeLayout> { RCow::from_slice(&[]) } fn combine( &self, other: ExtraChecksRef<'_>, checker: TypeCheckerMut<'_>, ) -> RResult<ROption<ExtraChecksBox>, ExtraChecksError> { Self::downcast_with_object(other, checker, |other, _| { let (min, max) = utils::min_max_by(self, other, |x| x.chars.len()); min.check_compatible_inner(max) .map(|_| RSome(ExtraChecksBox::from_value(max.clone(), TD_Opaque))) }) } } #[derive(Debug, Clone)] pub struct UnequalConstError { expected: RStr<'static>, found: RStr<'static>, } impl Display for UnequalConstError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!( f, "Expected the `GetConstant::CHARS` associated constant to be compatible with:\ \n {}\ \nFound:\ \n {}\ ", self.expected, self.found, ) } } impl std::error::Error for UnequalConstError {} ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// /// This is used to check that type checking within ExtraChecks works as expected. #[repr(C)] #[derive(Debug, Clone, StableAbi)] pub struct IdentityChecker { type_layout: Constructor<&'static TypeLayout>, } impl Display for IdentityChecker { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { Display::fmt(&self.type_layout, f) } } unsafe impl ExtraChecks for IdentityChecker { fn type_layout(&self) -> &'static TypeLayout { <Self as StableAbi>::LAYOUT } fn check_compatibility( &self, _layout_containing_self: &'static TypeLayout, layout_containing_other: &'static TypeLayout, ty_checker: TypeCheckerMut<'_>, ) -> RResult<(), ExtraChecksError> { Self::downcast_with_layout( layout_containing_other, ty_checker, |other, mut ty_checker| { let t_lay = self.type_layout.get(); let o_lay = other.type_layout.get(); ty_checker.check_compatibility(t_lay, o_lay).into_result() }, ) .observe(|res| { assert!( matches!(res, ROk(_) | RErr(ExtraChecksError::TypeChecker)), "It isn't either ROk or an RErr(TypeChecker):\n{:?}", res ) }) } fn nested_type_layouts(&self) -> RCowSlice<'_, &'static TypeLayout> { vec![self.type_layout.get()].into() } } #[repr(transparent)] #[derive(abi_stable::StableAbi)] struct Blah<T>(T); struct WrapTypeLayout<T>(T); impl<T> WrapTypeLayout<T> where T: StableAbi, { const EXTRA_CHECKS: &'static ManuallyDrop<StoredExtraChecks> = &ManuallyDrop::new(StoredExtraChecks::from_const( &IdentityChecker { type_layout: Constructor(get_type_layout::<T>), }, TD_Opaque, )); } fn wrap_type_layout<T>() -> &'static TypeLayout where T: StableAbi, { <()>::LAYOUT ._set_extra_checks( WrapTypeLayout::<T>::EXTRA_CHECKS .piped(Some) .piped(CmpIgnored::new), ) ._set_type_id(abi_stable::std_types::utypeid::new_utypeid::<Blah<T::StaticEquivalent>>) .piped(leak_value) } #[cfg(not(miri))] #[test] fn test_identity_extra_checker() { let list = vec![ wrap_type_layout::<u32>(), wrap_type_layout::<[(); 0]>(), wrap_type_layout::<[(); 1]>(), wrap_type_layout::<[u32; 3]>(), wrap_type_layout::<i32>(), wrap_type_layout::<bool>(), wrap_type_layout::<&mut ()>(), wrap_type_layout::<&mut i32>(), wrap_type_layout::<&()>(), wrap_type_layout::<&i32>(), wrap_type_layout::<&'static &'static ()>(), wrap_type_layout::<&'static mut &'static ()>(), wrap_type_layout::<&'static &'static mut ()>(), wrap_type_layout::<ptr::NonNull<()>>(), wrap_type_layout::<ptr::NonNull<i32>>(), wrap_type_layout::<RHashMap<RString, RString>>(), wrap_type_layout::<RHashMap<RString, i32>>(), wrap_type_layout::<RHashMap<i32, RString>>(), wrap_type_layout::<RHashMap<i32, i32>>(), wrap_type_layout::<Option<&()>>(), wrap_type_layout::<Option<&u32>>(), wrap_type_layout::<Option<extern "C" fn()>>(), wrap_type_layout::<ROption<()>>(), wrap_type_layout::<ROption<u32>>(), wrap_type_layout::<RCowStr<'_>>(), wrap_type_layout::<RCowSlice<'_, u32>>(), wrap_type_layout::<RArc<()>>(), wrap_type_layout::<RArc<u32>>(), wrap_type_layout::<RBox<()>>(), wrap_type_layout::<RBox<u32>>(), wrap_type_layout::<RBoxError>(), wrap_type_layout::<PhantomData<()>>(), wrap_type_layout::<PhantomData<RString>>(), wrap_type_layout::<ROnce>(), wrap_type_layout::<TypeLayout>(), ]; let globals = CheckingGlobals::new(); { for (i, this) in list.iter().cloned().enumerate() { for (j, other) in list.iter().cloned().enumerate() { let res = check_layout_compatibility_with_globals(this, other, &globals); if i == j { assert_eq!(res, Ok(())); } else { assert_ne!( res, Ok(()), "\n\nInterface:{:#?}\n\nimplementation:{:#?}", this, other, ); let found_extra_checks_error = res .unwrap_err() .flatten_errors() .into_iter() .any(|err| matches!(err, AbiInstability::ExtraCheckError { .. })); assert!(!found_extra_checks_error); } } } } } #[cfg(miri)] #[test] fn test_identity_extra_checker() { let globals = CheckingGlobals::new(); let interf0 = wrap_type_layout::<RHashMap<i32, RString>>(); let interf1 = wrap_type_layout::<TypeLayout>(); assert_eq!( check_layout_compatibility_with_globals(interf0, interf0, &globals), Ok(()) ); assert_ne!( check_layout_compatibility_with_globals(interf0, interf1, &globals), Ok(()) ); } ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// #[repr(C)] #[derive(abi_stable::StableAbi)] #[sabi(extra_checks = Self::NEW)] struct WithCyclicExtraChecker; impl WithCyclicExtraChecker { const NEW: IdentityChecker = IdentityChecker { type_layout: Constructor(get_type_layout::<Self>), }; } /// This is used to check that ExtraChecks that contain the type that they are checking /// alway return an error. #[test] fn test_cyclic_extra_checker() { let layout = <WithCyclicExtraChecker as StableAbi>::LAYOUT; let globals = CheckingGlobals::new(); let res = check_layout_compatibility_with_globals(layout, layout, &globals); assert_ne!(res, Ok(()), "layout:{:#?}", layout); let found_extra_checks_error = res .unwrap_err() .flatten_errors() .into_iter() .any(|err| matches!(err, AbiInstability::CyclicTypeChecking { .. })); assert!(found_extra_checks_error); } ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// #[repr(C)] #[derive(abi_stable::StableAbi)] #[sabi(extra_checks = Self::EXTRA_CHECKER)] struct WithLocalExtraChecker<C0, C1> { _marker: UnsafeIgnoredType<(C0, C1)>, } impl<C0, C1> WithLocalExtraChecker<C0, C1> where C0: StableAbi, C1: StableAbi, { const EXTRA_CHECKER: LocalExtraChecker = LocalExtraChecker { comp0: <C0 as StableAbi>::LAYOUT, comp1: <C1 as StableAbi>::LAYOUT, }; } #[repr(C)] #[derive(Debug, Clone, StableAbi)] pub struct LocalExtraChecker { comp0: &'static TypeLayout, comp1: &'static TypeLayout, } impl Display for LocalExtraChecker { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!( f, "\ncomp0 type_layout:\n{}\ncomp1 type_layout:\n{}\n", self.comp0, self.comp1, ) } } unsafe impl ExtraChecks for LocalExtraChecker { fn type_layout(&self) -> &'static TypeLayout { <Self as StableAbi>::LAYOUT } fn check_compatibility( &self, _layout_containing_self: &'static TypeLayout, layout_containing_other: &'static TypeLayout, ty_checker: TypeCheckerMut<'_>, ) -> RResult<(), ExtraChecksError> { Self::downcast_with_layout( layout_containing_other, ty_checker, |other, mut ty_checker| { ty_checker .local_check_compatibility(self.comp0, other.comp0) .or_else(|_| ty_checker.local_check_compatibility(self.comp0, other.comp1)) .or_else(|_| ty_checker.local_check_compatibility(self.comp1, other.comp0)) .or_else(|_| ty_checker.local_check_compatibility(self.comp1, other.comp1)) .into_result() }, ) } fn nested_type_layouts(&self) -> RCowSlice<'_, &'static TypeLayout> { vec![self.comp0, self.comp1].into() } } /// This is used to check that ExtraChecks that contain the type that they are checking /// alway return an error. #[cfg(not(miri))] #[test] fn test_local_extra_checker() { use abi_stable::external_types::ROnce; let list = vec![ WithLocalExtraChecker::<i32, u32>::LAYOUT, WithLocalExtraChecker::<RString, i32>::LAYOUT, WithLocalExtraChecker::<(), RString>::LAYOUT, WithLocalExtraChecker::<RVec<()>, ()>::LAYOUT, WithLocalExtraChecker::<ROnce, RVec<()>>::LAYOUT, ]; let globals = CheckingGlobals::new(); for window in list.windows(2) { let res = check_layout_compatibility_with_globals(window[0], window[1], &globals); assert_eq!(res, Ok(())); } for (i, this) in list.iter().cloned().enumerate() { for (j, other) in list.iter().cloned().enumerate() { let res = check_layout_compatibility_with_globals(this, other, &globals); if abs_sub_usize(j, i) <= 1 { assert_eq!(res, Ok(()), "j:{} i:{}", j, i); } else { assert_ne!( res, Ok(()), "\n\nInterface:{:#?}\n\nimplementation:{:#?}", this, other, ); let mut found_extra_checks_error = false; let mut found_name_error = false; for err in res.unwrap_err().flatten_errors().into_iter() { match err { AbiInstability::ExtraCheckError { .. } => found_extra_checks_error = true, AbiInstability::Name { .. } => found_name_error = true, _ => {} } } assert!( !found_extra_checks_error && found_name_error, "\n\nInterface:{:#?}\n\nimplementation:{:#?}", this, other, ); } } } } #[cfg(miri)] #[test] fn test_local_extra_checker() { let globals = CheckingGlobals::new(); let interf0 = WithLocalExtraChecker::<i32, u32>::LAYOUT; let interf1 = WithLocalExtraChecker::<RString, i32>::LAYOUT; let interf2 = WithLocalExtraChecker::<(), RString>::LAYOUT; assert_eq!( check_layout_compatibility_with_globals(interf0, interf1, &globals), Ok(()) ); assert_ne!( check_layout_compatibility_with_globals(interf0, interf2, &globals), Ok(()) ); }
use std::error::Error; use std::fmt; #[derive(PartialEq, Debug, Clone)] pub struct ValidationError { details: String, } impl ValidationError { pub fn new(msg: &str) -> ValidationError { ValidationError { details: msg.to_string(), } } } impl fmt::Display for ValidationError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.details) } } impl Error for ValidationError { fn description(&self) -> &str { &self.details } }
use std::collections::HashMap; use std::fmt::{Debug, Error, Formatter}; use std::hash::Hash; use std::slice::Iter; pub struct OrderedMap<S, T> where S: Hash + Eq + ToOwned<Owned = S>, { keys: Vec<S>, map: HashMap<S, T>, } type OrderedMapIter<'a, S> = Iter<'a, S>; impl<S, T> OrderedMap<S, T> where S: Hash + Eq + ToOwned<Owned = S>, { pub fn new() -> OrderedMap<S, T> { OrderedMap { keys: Vec::new(), map: HashMap::new(), } } pub fn keys(&self) -> &Vec<S> { &self.keys } pub fn len(&self) -> usize { self.keys.len() } pub fn iter(&self) -> OrderedMapIter<S> { self.keys.iter() } pub fn get(&self, k: &S) -> Option<&T> { self.map.get(k) } pub fn put(&mut self, k: S, v: T) -> Result<(), S> { let k1 = k.to_owned(); match self.map.insert(k, v) { None => { self.keys.push(k1); return Ok(()); } Some(_) => Err(k1), } } pub fn position(&self, x: &S) -> Option<usize> { let mut i = 0; for c in self.iter() { if x == c { return Some(i); } i += 1 } return None; } pub fn nth(&self, x: usize) -> Option<&S> { self.keys.get(x) } } impl<T> IntoIterator for OrderedMap<String, T> { type Item = String; type IntoIter = ::std::vec::IntoIter<String>; fn into_iter(self) -> Self::IntoIter { self.keys.into_iter() } } impl<S, T: Debug> Debug for OrderedMap<S, T> where S: Debug + Hash + Eq + ToOwned<Owned = S>, { fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> { for d in self.iter() { write!(fmt, "{:#?}", d)? } write!(fmt, "{:#?}", self.map)?; Ok(()) } }
table! { deals (id) { id -> Int4, buyer_id -> Nullable<Int4>, seller_id -> Nullable<Int4>, house_id -> Nullable<Int4>, access_code -> Varchar, status -> Varchar, created -> Timestamp, updated -> Timestamp, title -> Varchar, } } table! { houses (id) { id -> Int4, address -> Varchar, created -> Timestamp, updated -> Timestamp, google_address -> Nullable<Jsonb>, } } table! { profiles (id) { id -> Int4, uid -> Int4, title -> Varchar, intro -> Text, body -> Text, } } table! { sessions (id) { id -> Int4, uid -> Int4, token -> Text, active -> Bool, created -> Timestamp, updated -> Timestamp, } } table! { users (id) { id -> Int4, name -> Varchar, email -> Varchar, password_hash -> Varchar, roles -> Array<Text>, } } joinable!(deals -> houses (house_id)); joinable!(profiles -> users (uid)); joinable!(sessions -> users (uid)); allow_tables_to_appear_in_same_query!( deals, houses, profiles, sessions, users, );
use crate::{ activity::events::ActivityEvent, handler::DiscordMsg, lobby::events::LobbyEvent, overlay::events::OverlayEvent, proto::event::ClassifiedEvent, relations::events::RelationshipEvent, user::{events::UserEvent, User}, }; use tokio::sync::{broadcast, watch}; /// An event wheel, with a different `spoke` per class of events pub struct Wheel { lobby: broadcast::Sender<LobbyEvent>, activity: broadcast::Sender<ActivityEvent>, relations: broadcast::Sender<RelationshipEvent>, user: watch::Receiver<UserState>, overlay: watch::Receiver<OverlayState>, } impl Wheel { pub fn new(error: Box<dyn OnError>) -> (Self, WheelHandler) { let (lobby_tx, _lobby_rx) = broadcast::channel(10); let (activity_tx, _activity_rx) = broadcast::channel(10); let (rl_tx, _rl_rx) = broadcast::channel(10); let (user_tx, user_rx) = watch::channel(UserState::Disconnected(crate::Error::NoConnection)); let (overlay_tx, overlay_rx) = watch::channel(OverlayState { enabled: false, visible: crate::overlay::Visibility::Hidden, }); ( Self { lobby: lobby_tx.clone(), activity: activity_tx.clone(), relations: rl_tx.clone(), user: user_rx, overlay: overlay_rx, }, WheelHandler { lobby: lobby_tx, activity: activity_tx, relations: rl_tx, user: user_tx, overlay: overlay_tx, error, }, ) } #[inline] pub fn lobby(&self) -> LobbySpoke { LobbySpoke(self.lobby.subscribe()) } #[inline] pub fn activity(&self) -> ActivitySpoke { ActivitySpoke(self.activity.subscribe()) } #[inline] pub fn relationships(&self) -> RelationshipSpoke { RelationshipSpoke(self.relations.subscribe()) } #[inline] pub fn user(&self) -> UserSpoke { UserSpoke(self.user.clone()) } #[inline] pub fn overlay(&self) -> OverlaySpoke { OverlaySpoke(self.overlay.clone()) } } pub struct LobbySpoke(pub broadcast::Receiver<LobbyEvent>); pub struct ActivitySpoke(pub broadcast::Receiver<ActivityEvent>); pub struct RelationshipSpoke(pub broadcast::Receiver<RelationshipEvent>); pub struct UserSpoke(pub watch::Receiver<UserState>); pub struct OverlaySpoke(pub watch::Receiver<OverlayState>); #[async_trait::async_trait] pub trait OnError: Send + Sync { async fn on_error(&self, _error: crate::Error) {} } #[async_trait::async_trait] impl<F> OnError for F where F: Fn(crate::Error) + Send + Sync, { async fn on_error(&self, error: crate::Error) { self(error) } } #[derive(Debug)] pub enum UserState { Connected(User), Disconnected(crate::Error), } #[derive(Debug)] pub struct OverlayState { /// Whether the user has the overlay enabled or disabled. If the overlay /// is disabled, all the functionality of the SDK will still work. The /// calls will instead focus the Discord client and show the modal there /// instead of in application. pub enabled: bool, /// Whether the overlay is visible or not. pub visible: crate::overlay::Visibility, } /// The write part of the [`Wheel`] which is used by the actual handler task pub struct WheelHandler { lobby: broadcast::Sender<LobbyEvent>, activity: broadcast::Sender<ActivityEvent>, relations: broadcast::Sender<RelationshipEvent>, user: watch::Sender<UserState>, overlay: watch::Sender<OverlayState>, error: Box<dyn OnError>, } #[async_trait::async_trait] impl super::DiscordHandler for WheelHandler { async fn on_message(&self, msg: DiscordMsg) { match msg { DiscordMsg::Error(err) => self.error.on_error(err).await, DiscordMsg::Event(eve) => match ClassifiedEvent::from(eve) { ClassifiedEvent::Lobby(lobby) => { if let Err(e) = self.lobby.send(lobby) { tracing::warn!(event = ?e.0, "Lobby event was unobserved"); } } ClassifiedEvent::User(user) => { let us = match user { UserEvent::Connect(eve) => UserState::Connected(eve.user), UserEvent::Update(eve) => UserState::Connected(eve.user), UserEvent::Disconnect(de) => UserState::Disconnected(de.reason), }; if let Err(e) = self.user.send(us) { tracing::warn!(error = %e, "User event was unobserved"); } } ClassifiedEvent::Relations(re) => { if let Err(e) = self.relations.send(re) { tracing::warn!(event = ?e.0, "Relationship event was unobserved"); } } ClassifiedEvent::Activity(activity) => { if let Err(e) = self.activity.send(activity) { tracing::warn!(event = ?e.0, "Activity event was unobserved"); } } ClassifiedEvent::Overlay(overlay) => { let os = match overlay { OverlayEvent::Update(update) => OverlayState { enabled: update.enabled, visible: update.visible, }, }; if let Err(e) = self.overlay.send(os) { tracing::warn!(error = %e, "Overlay event was unobserved"); } } }, } } }
use std::{ error, fmt::{self, Display, Formatter}, }; use crate::MAGIC_HEADER_BYTES; #[derive(Debug)] pub enum Error { InvalidMagicHeaderString(String), InvalidPageSize(String), } impl Display for Error { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { Self::InvalidMagicHeaderString(v) => write!( f, "expected '{}', found {:?}", std::str::from_utf8(&MAGIC_HEADER_BYTES).unwrap(), v, ), Self::InvalidPageSize(msg) => write!(f, ""), } } } impl error::Error for Error {}
use std::fs::File; use std::io::{BufRead, BufReader}; use std::cmp::{min, max}; fn gcd(mut a: usize, mut b: usize) -> usize { while b > 0 { let rem = a % b; a = b; b = rem; } a } fn main() { let grid = BufReader::new(File::open("in_10.txt").unwrap()).lines().map(|row| row.unwrap().chars().collect::<Vec<_>>()).collect::<Vec<_>>(); let (hgt, wid, mut max_det, mut vapour) = (grid.len(), grid[0].len(), 0, (0, 0)); for sy in 0..hgt { for sx in 0..wid { if grid[sy][sx] == '#' { let (mut detect, mut btwn, mut aster, mut ang) = (0, vec![vec![0; wid]; hgt], vec![], vec![vec![0.; wid]; hgt]); for ey in 0..hgt { for ex in 0..wid { if grid[ey][ex] == '#' { if ex == sx && ey == sy { continue; } let num = gcd(max(sx, ex) - min(sx, ex), max(sy, ey) - min(sy, ey)); btwn[ey][ex] = (1..num).filter(|i| { let (bx, by) = ((sx * (num - i) + ex * i) / num, (sy * (num - i) + ey * i) / num); grid[by][bx] == '#' }).count(); if btwn[ey][ex] == 0 { detect += 1; } aster.push((ex, ey)); ang[ey][ex] = (ex as f64 - sx as f64).atan2(ey as f64 - sy as f64); } } } if detect >= max_det { max_det = detect; aster.sort_by(|(x1, y1), (x2, y2)| ang[*y2][*x2].partial_cmp(&ang[*y1][*x1]).unwrap()); aster.sort_by_key(|(x, y)| btwn[*y][*x]); vapour = aster[199]; } } } } println!("Part A: {}", max_det); // 221 println!("Part B: {}", vapour.0 * 100 + vapour.1); // 806 }
//! Small library providing some macros helpful for asserting. The API is very //! similar to the API provided by the stdlib's own `assert_eq!`, `assert_ne!`, //! `debug_assert_eq!`, or `debug_assert_ne!`. //! //! | Name | Enabled | Equivalent to | //! | -------------------- | ----------------------------- | -------------------------------------------- | //! | `assert_le!` | Always | `assert!(a <= b)` | //! | `assert_lt!` | Always | `assert!(a < b)` | //! | `assert_ge!` | Always | `assert!(a >= b)` | //! | `assert_gt!` | Always | `assert!(a > b)` | //! | `debug_assert_le!` | `if cfg!(debug_assertions)` | `debug_assert!(a <= b)` | //! | `debug_assert_lt!` | `if cfg!(debug_assertions)` | `debug_assert!(a < b)` | //! | `debug_assert_ge!` | `if cfg!(debug_assertions)` | `debug_assert!(a >= b)` | //! | `debug_assert_gt!` | `if cfg!(debug_assertions)` | `debug_assert!(a > b)` | //! | `debug_unreachable!` | `if cfg!(debug_assertions)` | `unreachable!` when debug_assertions are on. | //! //! When one of the assertions fails, it prints out a message like the following: //! //! ```text //! thread 'main' panicked at 'assertion failed: `left < right` //! left: `4`, //! right: `3`', src/main.rs:47:5 //! note: Run with `RUST_BACKTRACE=1` for a backtrace. //! ``` //! //! # Example //! //! ```rust //! #[macro_use] //! extern crate more_asserts; //! //! #[derive(Debug, PartialEq, PartialOrd)] //! enum Example { Foo, Bar } //! //! fn main() { //! assert_le!(3, 4); //! assert_ge!(10, 10, //! "You can pass a message too (just like `assert_eq!`)"); //! debug_assert_lt!(1.3, 4.5, //! "Format syntax is supported ({}).", "also like `assert_eq!`"); //! //! assert_gt!(Example::Bar, Example::Foo, //! "It works on anything that implements PartialOrd, PartialEq, and Debug!"); //! } //! ``` #![deny(missing_docs)] /// Panics if the first expression is not strictly less than the second. /// Requires that the values be comparable with `<`. /// /// On failure, panics and prints the values out in a manner similar to /// prelude's `assert_eq!`. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// assert_lt!(3, 4); /// assert_lt!(3, 4, "With a message"); /// assert_lt!(3, 4, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! assert_lt { ($left:expr, $right:expr) => ({ let (left, right) = (&($left), &($right)); assert!(left < right, "assertion failed: `(left < right)`\n left: `{:?}`,\n right: `{:?}`", left, right); }); ($left:expr, $right:expr, ) => ({ assert_lt!($left, $right); }); ($left:expr, $right:expr, $($msg_args:tt)+) => ({ let (left, right) = (&($left), &($right)); assert!(left < right, "assertion failed: `(left < right)`\n left: `{:?}`,\n right: `{:?}`: {}", left, right, format_args!($($msg_args)+)); }) } /// Panics if the first expression is not strictly greater than the second. /// Requires that the values be comparable with `>`. /// /// On failure, panics and prints the values out in a manner similar to /// prelude's `assert_eq!`. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// assert_gt!(5, 3); /// assert_gt!(5, 3, "With a message"); /// assert_gt!(5, 3, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! assert_gt { ($left:expr, $right:expr) => ({ let (left, right) = (&($left), &($right)); assert!(left > right, "assertion failed: `(left > right)`\n left: `{:?}`,\n right: `{:?}`", left, right); }); ($left:expr, $right:expr, ) => ({ assert_gt!($left, $right); }); ($left:expr, $right:expr, $($msg_args:tt)+) => ({ let (left, right) = (&($left), &($right)); assert!(left > right, "assertion failed: `(left > right)`\n left: `{:?}`,\n right: `{:?}`: {}", left, right, format_args!($($msg_args)+)); }) } /// Panics if the first expression is not less than or equal to the second. /// Requires that the values be comparable with `<=`. /// /// On failure, panics and prints the values out in a manner similar to /// prelude's `assert_eq!`. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// assert_le!(4, 4); /// assert_le!(4, 5); /// assert_le!(4, 5, "With a message"); /// assert_le!(4, 4, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! assert_le { ($left:expr, $right:expr) => ({ let (left, right) = (&($left), &($right)); assert!(left <= right, "assertion failed: `(left <= right)`\n left: `{:?}`,\n right: `{:?}`", left, right); }); ($left:expr, $right:expr, ) => ({ assert_le!($left, $right); }); ($left:expr, $right:expr, $($msg_args:tt)+) => ({ let (left, right) = (&($left), &($right)); assert!(left <= right, "assertion failed: `(left <= right)`\n left: `{:?}`,\n right: `{:?}`: {}", left, right, format_args!($($msg_args)+)); }) } /// Panics if the first expression is not greater than or equal to the second. /// Requires that the values be comparable with `>=`. /// /// On failure, panics and prints the values out in a manner similar to /// prelude's `assert_eq!`. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// assert_ge!(4, 4); /// assert_ge!(4, 3); /// assert_ge!(4, 3, "With a message"); /// assert_ge!(4, 4, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! assert_ge { ($left:expr, $right:expr) => ({ let (left, right) = (&($left), &($right)); assert!(left >= right, "assertion failed: `(left >= right)`\n left: `{:?}`,\n right: `{:?}`", left, right); }); ($left:expr, $right:expr, ) => ({ assert_ge!($left, $right); }); ($left:expr, $right:expr, $($msg_args:tt)+) => ({ let (left, right) = (&($left), &($right)); assert!(left >= right, "assertion failed: `(left >= right)`\n left: `{:?}`,\n right: `{:?}`: {}", left, right, format_args!($($msg_args)+)); }) } /// Same as `assert_lt!` in debug builds or release builds where the /// `-C debug-assertions` was provided to the compiler. For all other builds, /// vanishes without a trace. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// // These are compiled to nothing if debug_assertions are off! /// debug_assert_lt!(3, 4); /// debug_assert_lt!(3, 4, "With a message"); /// debug_assert_lt!(3, 4, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! debug_assert_lt { ($($arg:tt)+) => { if cfg!(debug_assertions) { assert_lt!($($arg)+); } } } /// Same as `assert_gt!` in debug builds or release builds where the /// `-C debug-assertions` was provided to the compiler. For all other builds, /// vanishes without a trace. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// // These are compiled to nothing if debug_assertions are off! /// debug_assert_gt!(5, 3); /// debug_assert_gt!(5, 3, "With a message"); /// debug_assert_gt!(5, 3, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! debug_assert_gt { ($($arg:tt)+) => { if cfg!(debug_assertions) { assert_gt!($($arg)+); } } } /// Same as `assert_le!` in debug builds or release builds where the /// `-C debug-assertions` was provided to the compiler. For all other builds, /// vanishes without a trace. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// // These are compiled to nothing if debug_assertions are off! /// debug_assert_le!(4, 4); /// debug_assert_le!(4, 5); /// debug_assert_le!(4, 5, "With a message"); /// debug_assert_le!(4, 4, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! debug_assert_le { ($($arg:tt)+) => { if cfg!(debug_assertions) { assert_le!($($arg)+); } } } /// Same as `assert_ge!` in debug builds or release builds where the /// `-C debug-assertions` was provided to the compiler. For all other builds, /// vanishes without a trace. /// /// Optionally may take an additional message to display on failure, which /// is formatted using standard format syntax. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// // These are compiled to nothing if debug_assertions are off! /// debug_assert_ge!(4, 4); /// debug_assert_ge!(4, 3); /// debug_assert_ge!(4, 3, "With a message"); /// debug_assert_ge!(4, 4, "With a formatted message: {}", "oh no"); /// } /// ``` #[macro_export] macro_rules! debug_assert_ge { ($($arg:tt)+) => { if cfg!(debug_assertions) { assert_ge!($($arg)+); } } } /// Panics if reached. This is a variant of the standard library's `unreachable!` /// macro that is controlled by `cfg!(debug_assertions)`. /// /// Same as prelude's `unreachable!` in debug builds or release builds where the /// `-C debug-assertions` was provided to the compiler. For all other builds, /// vanishes without a trace. /// /// # Example /// /// ```rust /// #[macro_use] /// extern crate more_asserts; /// /// fn main() { /// // You probably wouldn't actually use this here /// let mut value = 0.5; /// if value < 0.0 { /// debug_unreachable!("Value out of range {}", value); /// value = 0.0; /// } /// } /// ``` #[macro_export] macro_rules! debug_unreachable { ($($arg:tt)*) => { if cfg!(debug_assertions) { unreachable!($($arg)*); } } } #[cfg(test)] mod tests { use std::panic::catch_unwind; #[derive(PartialOrd, PartialEq, Debug)] enum DummyType { Foo, Bar, Baz } #[test] fn test_assert_lt() { assert_lt!(3, 4); assert_lt!(4.0, 4.5); assert_lt!("a string", "b string"); assert_lt!(DummyType::Foo, DummyType::Bar, "Message with {}", "cool formatting"); let a = &DummyType::Foo; let b = &DummyType::Baz; assert_lt!(a, b); assert!(catch_unwind(|| assert_lt!(5, 3)).is_err()); assert!(catch_unwind(|| assert_lt!(5, 5)).is_err()); assert!(catch_unwind(|| assert_lt!(DummyType::Bar, DummyType::Foo)).is_err()); } #[test] fn test_assert_gt() { assert_gt!(4, 3); assert_gt!(4.5, 4.0); assert_gt!("b string", "a string"); assert_gt!(DummyType::Bar, DummyType::Foo, "Message with {}", "cool formatting"); let a = &DummyType::Foo; let b = &DummyType::Baz; assert_gt!(b, a); assert!(catch_unwind(|| assert_gt!(3, 5)).is_err()); assert!(catch_unwind(|| assert_gt!(5, 5)).is_err()); assert!(catch_unwind(|| assert_gt!(DummyType::Foo, DummyType::Bar)).is_err()); } #[test] fn test_assert_le() { assert_le!(3, 4); assert_le!(4, 4); assert_le!(4.0, 4.5); assert_le!("a string", "a string"); assert_le!("a string", "b string"); assert_le!(DummyType::Foo, DummyType::Bar, "Message"); assert_le!(DummyType::Foo, DummyType::Foo, "Message with {}", "cool formatting"); let a = &DummyType::Foo; let b = &DummyType::Baz; assert_le!(a, a); assert_le!(a, b); assert!(catch_unwind(|| assert_le!(5, 3)).is_err()); assert!(catch_unwind(|| assert_le!(DummyType::Bar, DummyType::Foo)).is_err()); } #[test] fn test_assert_ge() { assert_ge!(4, 3); assert_ge!(4, 4); assert_ge!(4.5, 4.0); assert_ge!(5.0, 5.0); assert_ge!("a string", "a string"); assert_ge!("b string", "a string"); assert_ge!(DummyType::Bar, DummyType::Bar, "Example"); assert_ge!(DummyType::Bar, DummyType::Foo, "Message with {}", "cool formatting"); let a = &DummyType::Foo; let b = &DummyType::Baz; assert_ge!(a, a); assert_ge!(b, a); assert!(catch_unwind(|| assert_ge!(3, 5)).is_err()); assert!(catch_unwind(|| assert_ge!(DummyType::Foo, DummyType::Bar)).is_err()); } // @@TODO: how to test the debug macros? }
// #![allow(non_snake_case)] fn main() { simple(0.0, 0.0, 89.0, 0.0); } fn simple(lat1: f64, lng1: f64, lat2: f64, lng2: f64) { let a = 6378137.0; // 長軸半径 (赤道半径) let phi1 = lat1.to_radians(); let L1 = lng1.to_radians(); let phi2 = lat2.to_radians(); let L2 = lng2.to_radians(); let L = L2 - L1; let mut alpha1 = L.sin().atan2(phi1.cos() * phi2.tan() - phi1.sin() * L.cos()).to_degrees(); if alpha1 < 0.0 { alpha1 = alpha1 + 360.0 } let s = a * (phi1.sin() * phi2.sin() + phi1.cos() * phi2.cos() * L.cos()).acos(); println!("distance: {:?}", s); println!("direction: {:?}", alpha1); }
{doc_comment} #[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Ord, PartialOrd)] #[repr(C)] pub struct {type_name} {{ bits: {bits_type} }} impl {type_name} {{ {value_defs}{alias_defs} pub const ALL: {type_name} = {type_name} {{ bits: {all_bits} }}; /// Returns the empty domain. pub const FAILED: {type_name} = {type_name} {{ bits: 0 }}; /// Returns the full domain. pub fn all() -> Self {{ Self::ALL }} /// Insert values in the domain. pub fn insert(&mut self, alternatives: Self) {{ self.bits |= alternatives.bits }} /// Lists the alternatives contained in the domain. pub fn list(&self) -> impl Iterator<Item=Self> + 'static {{ let bits = self.bits; (0..{num_values}).map(|x| 1 << x) .filter(move |x| (bits & x) != 0) .map(|x| {type_name} {{ bits: x }}) }} /// Partition the domain into the intersection with `other` and its complement. pub fn bisect(&self, other: Self) -> impl Iterator<Item = Self> {{ (*self & other).into_option().into_iter() .chain((*self & !other).into_option().into_iter()) }} pub fn into_option(self) -> Option<Self> {{ if self.is_failed() {{ None }} else {{ Some(self) }} }} /// Indicates if two choices will have the same value. pub fn eq(&self, other: Self) -> bool {{ self.is_constrained() && *self == other }} /// Indicates if two choices cannot be equal. pub fn neq(&self, other: Self) -> bool {{ !self.intersects(other) }} {inverse} }} impl Domain for {type_name} {{ fn is_failed(&self) -> bool {{ self.bits == 0 }} fn is_constrained(&self) -> bool {{ self.bits.count_ones() <= 1 }} fn contains(&self, other: Self) -> bool {{ (self.bits & other.bits) == other.bits }} fn intersects(&self, other: Self) -> bool {{ (self.bits & other.bits) != 0 }} fn restrict(&mut self, alternatives: Self) {{ self.bits &= alternatives.bits }} }} impl std::ops::BitAnd for {type_name} {{ type Output = {type_name}; fn bitand(self, other: Self) -> Self {{ {type_name} {{ bits: self.bits & other.bits }} }} }} impl std::ops::BitOr for {type_name} {{ type Output = {type_name}; fn bitor(self, other: Self) -> Self {{ {type_name} {{ bits: self.bits | other.bits }} }} }} impl std::ops::BitXor for {type_name} {{ type Output = {type_name}; fn bitxor(self, other: Self) -> Self {{ {type_name} {{ bits: self.bits ^ other.bits }} }} }} impl std::ops::Not for {type_name} {{ type Output = {type_name}; fn not(self) -> Self {{ {type_name} {{ bits: self.bits ^ {all_bits} }} }} }} impl std::ops::BitOrAssign for {type_name} {{ fn bitor_assign(&mut self, other: Self) {{ self.bits |= other.bits; }} }} impl std::ops::BitAndAssign for {type_name} {{ fn bitand_assign(&mut self, other: Self) {{ self.bits &= other.bits; }} }} impl std::fmt::Debug for {type_name} {{ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {{ let mut values = vec![]; {printers} if values.is_empty() {{ write!(f, "--") }} else {{ write!(f, "{{}}", values[0])?; for value in &values[1..] {{ write!(f, " | {{}}", value)?; }} Ok(()) }} }} }} impl std::fmt::Display for {type_name} {{ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {{ let mut values = vec![]; {printers} f.write_str("{{")?; if !values.is_empty() {{ write!(f, "{{}}", values[0])?; for value in &values[1..] {{ write!(f, ", {{}}", value)?; }} }} f.write_str("}}") }} }}
#[derive(Serialize, Deserialize, Debug,)] pub enum ErrorCode { BAD_REQUEST, NOT_FOUND, INTERNAL }
#[path = "band_2/with_big_integer_left.rs"] mod with_big_integer_left; #[path = "band_2/with_small_integer_left.rs"] mod with_small_integer_left; test_stdout!(without_integer_right_errors_badarith, "{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n");
pub mod matrix { pub fn print_matrix(mat: &Vec<Vec<i32>>) { for i in mat.iter() { println!("{:?}", i); } } pub fn create_identity_matrix(row_size: usize, col_size: usize) -> Vec<Vec<i32>>{ let mut mat = vec![Vec::with_capacity(row_size); col_size]; for i in 0..mat.len() { for j in 0..mat.len() { if i == j { mat[i].push(1); } else { mat[i].push(0); } } } mat } }
// memory layout fn destroy(value: Vec<i32>){ println!("sending to the kitchen sink"); for i in value.iter(){ println!("{}",i); } } // duplicate fn dup(values: &mut Vec<i32>){ for i in values.iter_mut() { *i = (*i) * (*i); } } fn main(){ let mut x = vec![4, 6,954, 85, 45 , 323, 84, 9]; dup(&mut x); println!("{:?}", x); destroy(x); }
use itertools::Itertools; use crate::file_util::read_lines_as_u32; fn find_pair_summing_to(numbers: &[u32], value: u32) -> Option<(&u32, &u32)> { numbers.iter().tuple_combinations() .find(|(first, second)| *first + *second == value) } fn find_triple_summing_to(numbers: &[u32], value: u32) -> Option<(&u32, &u32, &u32)> { numbers.iter().tuple_combinations() .find(|(first, second, third)| *first + *second + *third == value) } #[allow(dead_code)] pub fn run_day_one() { let numbers = read_lines_as_u32("assets/day_one").collect_vec(); let first_result = find_pair_summing_to(&numbers, 2020); let second_result = find_triple_summing_to(&numbers, 2020); match first_result { None => println!("No match!"), Some(products) => println!("Result: {}", products.0 * products.1) } match second_result { None => println!("No match!"), Some(products) => println!("Result: {}", products.0 * products.1 * products.2) } } #[cfg(test)] mod tests { use crate::day_one::*; #[test] fn should_produce_empty_if_none_sum_for_pair() { assert_eq!(find_pair_summing_to(&vec!(1, 2, 3, 4), 12), None) } #[test] fn should_produce_pair_if_sum_for_pair() { assert_eq!(find_pair_summing_to(&vec!(1, 2, 3, 4), 7), Some((&3, &4))) } #[test] fn should_produce_empty_if_none_sum_for_triple() { assert_eq!(find_triple_summing_to(&vec!(1, 2, 3, 4), 12), None) } #[test] fn should_produce_pair_if_sum() { assert_eq!(find_triple_summing_to(&vec!(1, 2, 3, 4), 9), Some((&2, &3, &4))) } }
use crate::prelude::*; #[repr(C)] #[derive(Debug)] pub struct VkSubpassDependency { pub srcSubpass: u32, pub dstSubpass: u32, pub srcStageMask: VkPipelineStageFlagBits, pub dstStageMask: VkPipelineStageFlagBits, pub srcAccessMask: VkAccessFlagBits, pub dstAccessMask: VkAccessFlagBits, pub dependencyFlagBits: VkDependencyFlagBits, } impl VkSubpassDependency { pub fn new<S, T, U, V, W>( src_subpass: u32, dst_subpass: u32, src_stage_mask: S, dst_stage_mask: T, src_access_mask: U, dst_access_mask: V, dependency_flags: W, ) -> Self where S: Into<VkPipelineStageFlagBits>, T: Into<VkPipelineStageFlagBits>, U: Into<VkAccessFlagBits>, V: Into<VkAccessFlagBits>, W: Into<VkDependencyFlagBits>, { VkSubpassDependency { srcSubpass: src_subpass, dstSubpass: dst_subpass, srcStageMask: src_stage_mask.into(), dstStageMask: dst_stage_mask.into(), srcAccessMask: src_access_mask.into(), dstAccessMask: dst_access_mask.into(), dependencyFlagBits: dependency_flags.into(), } } }
use std::{collections::HashMap, fmt}; use serde::{Serialize, Deserialize}; pub struct SendMessage { pub content: String, pub nonce: String, pub attachments: Vec<String>, pub replies: HashMap<String, bool> } #[derive(Debug, Serialize, Deserialize)] pub struct Message { pub _id: String, pub nonce: String, pub channel: String, pub author: String, pub content: String, pub mentions: Option<Vec<String>>, pub attachments: Option<Vec<MessageAttachments>>, pub edited: Option<String> } #[derive(Debug, Serialize, Deserialize)] pub struct MessageAttachments { pub _id: String, pub tag: String, pub filename: String, pub metadata: MessageMetadata, pub content_type: String, pub size: usize } #[derive(Debug, Serialize, Deserialize)] pub struct MessageMetadata { #[serde(rename = "type")] pub _type: String, pub width: usize, pub height: usize, } impl fmt::Display for Message { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if self.content.is_empty() { write!(f, "Channel: {}, Author: {}", self.channel, self.author) } else { write!(f, "Channel: {}, Author: {}, Content: {}", self.channel, self.author, self.content) } } }
/* * Firecracker API * * RESTful public-facing API. The API is accessible through HTTP calls on specific URLs carrying JSON modeled data. The transport medium is a Unix Domain Socket. * * The version of the OpenAPI document: 0.25.0 * Contact: compute-capsule@amazon.com * Generated by: https://openapi-generator.tech */ /// BalloonStats : Describes the balloon device statistics. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BalloonStats { /// Target number of pages the device aims to hold. #[serde(rename = "target_pages")] pub target_pages: i32, /// Actual number of pages the device is holding. #[serde(rename = "actual_pages")] pub actual_pages: i32, /// Target amount of memory (in MiB) the device aims to hold. #[serde(rename = "target_mib")] pub target_mib: i32, /// Actual amount of memory (in MiB) the device is holding. #[serde(rename = "actual_mib")] pub actual_mib: i32, /// The amount of memory that has been swapped in (in bytes). #[serde(rename = "swap_in", skip_serializing_if = "Option::is_none")] pub swap_in: Option<i64>, /// The amount of memory that has been swapped out to disk (in bytes). #[serde(rename = "swap_out", skip_serializing_if = "Option::is_none")] pub swap_out: Option<i64>, /// The number of major page faults that have occurred. #[serde(rename = "major_faults", skip_serializing_if = "Option::is_none")] pub major_faults: Option<i64>, /// The number of minor page faults that have occurred. #[serde(rename = "minor_faults", skip_serializing_if = "Option::is_none")] pub minor_faults: Option<i64>, /// The amount of memory not being used for any purpose (in bytes). #[serde(rename = "free_memory", skip_serializing_if = "Option::is_none")] pub free_memory: Option<i64>, /// The total amount of memory available (in bytes). #[serde(rename = "total_memory", skip_serializing_if = "Option::is_none")] pub total_memory: Option<i64>, /// An estimate of how much memory is available (in bytes) for starting new applications, without pushing the system to swap. #[serde(rename = "available_memory", skip_serializing_if = "Option::is_none")] pub available_memory: Option<i64>, /// The amount of memory, in bytes, that can be quickly reclaimed without additional I/O. Typically these pages are used for caching files from disk. #[serde(rename = "disk_caches", skip_serializing_if = "Option::is_none")] pub disk_caches: Option<i64>, /// The number of successful hugetlb page allocations in the guest. #[serde( rename = "hugetlb_allocations", skip_serializing_if = "Option::is_none" )] pub hugetlb_allocations: Option<i64>, /// The number of failed hugetlb page allocations in the guest. #[serde(rename = "hugetlb_failures", skip_serializing_if = "Option::is_none")] pub hugetlb_failures: Option<i64>, } impl BalloonStats { /// Describes the balloon device statistics. pub fn new( target_pages: i32, actual_pages: i32, target_mib: i32, actual_mib: i32, ) -> BalloonStats { BalloonStats { target_pages, actual_pages, target_mib, actual_mib, swap_in: None, swap_out: None, major_faults: None, minor_faults: None, free_memory: None, total_memory: None, available_memory: None, disk_caches: None, hugetlb_allocations: None, hugetlb_failures: None, } } }
#![feature(proc_macro)] extern crate proc_macro; use proc_macro::TokenStream; #[proc_macro_attribute] pub fn rustc_ice(_: TokenStream, x: TokenStream) -> TokenStream { x }
use std::fmt; use std::error; /// Error is the error value in an operation's /// result. /// /// Based on the two possible values, the operation /// may be retried. pub enum Error<E> { /// Permanent means that it's impossible to execute the operation /// successfully. This error is immediately returned from `retry()`. Permanent(E), /// Transient means that the error is temporary, the operation should /// be retried according to the backoff policy. Transient(E), } impl<E> fmt::Display for Error<E> where E: fmt::Display { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self { Error::Permanent(ref err) | Error::Transient(ref err) => err.fmt(f), } } } impl<E> fmt::Debug for Error<E> where E: fmt::Debug { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { let (name, err) = match *self { Error::Permanent(ref err) => ("Permanent", err as &fmt::Debug), Error::Transient(ref err) => ("Transient", err as &fmt::Debug), }; f.debug_tuple(name).field(err).finish() } } impl<E> error::Error for Error<E> where E: error::Error { fn description(&self) -> &str { match *self { Error::Permanent(_) => "permanent error", Error::Transient(_) => "transient error", } } fn cause(&self) -> Option<&error::Error> { match *self { Error::Permanent(ref err) | Error::Transient(ref err) => err.cause(), } } } /// By default all errors are transient. Permanent errors can /// be constructed explicitly. This implementation is for making /// the question mark operator (?) and the `try!` macro to work. impl<E> From<E> for Error<E> { fn from(err: E) -> Error<E> { Error::Transient(err) } }
use crate::Error; use half::f16; use openexr_sys as sys; use crate::core::refptr::{OpaquePtr, Ref, RefMut}; type Result<T, E = Error> = std::result::Result<T, E>; /// A usually small, low-dynamic range image, /// that is intended to be stored in an image file's header #[repr(transparent)] pub struct PreviewImage(pub(crate) *mut sys::Imf_PreviewImage_t); unsafe impl OpaquePtr for PreviewImage { type SysPointee = sys::Imf_PreviewImage_t; type Pointee = PreviewImage; } pub type PreviewImageRef<'a, P = PreviewImage> = Ref<'a, P>; pub type PreviewImageRefMut<'a, P = PreviewImage> = RefMut<'a, P>; impl PreviewImage { /// Creates a new [`PreviewImage`] with dimensions width = 0 and height = 0 /// /// ## Errors /// * [`Error::Base`] - If an error occurs /// pub fn empty() -> Result<PreviewImage> { PreviewImage::with_dimensions(0, 0) } /// Creates a new [`PreviewImage`] with the provided dimensions /// /// ## Errors /// * [`Error::Overflow`] - If the size of the image is bigger than the supported size /// * [`Error::Base`] - If an error occurs /// pub fn with_dimensions(width: u32, height: u32) -> Result<PreviewImage> { let mut _inner = std::ptr::null_mut(); unsafe { sys::Imf_PreviewImage_ctor( &mut _inner, width, height, std::ptr::null(), ) .into_result()?; } Ok(PreviewImage(_inner)) } /// Creates a new [`PreviewImage`] with the provided dimensions and pixels /// /// ## Errors /// * [`Error::Overflow`] - If the size of the image is bigger than the supported size /// * [`Error::Base`] - If an error occurs /// pub fn with_pixels( width: u32, height: u32, pixels: &[PreviewRgba], ) -> Result<PreviewImage> { let mut _inner = std::ptr::null_mut(); unsafe { sys::Imf_PreviewImage_ctor( &mut _inner, width, height, pixels.as_ptr() as *const sys::Imf_PreviewRgba_t, ) .into_result()?; } Ok(PreviewImage(_inner)) } /// Returns the width of the [`PreviewImage`] /// pub fn width(&self) -> u32 { let mut value = 0; unsafe { sys::Imf_PreviewImage_width(self.0, &mut value) .into_result() .expect("Error getting 'width' property"); } value } /// Returns the height of the [`PreviewImage`] /// pub fn height(&self) -> u32 { let mut value = 0; unsafe { sys::Imf_PreviewImage_height(self.0, &mut value) .into_result() .expect("Error getting 'height' property"); } value } /// Get the image pixels as a slice /// pub fn pixels<'a>(&'a self) -> &'a [PreviewRgba] { let mut pixels = std::ptr::null(); unsafe { sys::Imf_PreviewImage_pixels_const(self.0, &mut pixels) .into_result() .expect("Error getting pixels"); if pixels.is_null() { panic!("Pixels pointer is null"); } let pixel_count = (self.width() * self.height()) as usize; std::slice::from_raw_parts( pixels as *const PreviewRgba, pixel_count, ) } } /// Get the image pixels as a mutable slice /// pub fn mut_pixels<'a>(&'a mut self) -> &'a mut [PreviewRgba] { let mut pixels = std::ptr::null_mut(); unsafe { sys::Imf_PreviewImage_pixels(self.0, &mut pixels) .into_result() .expect("Error getting mutable pixels"); if pixels.is_null() { panic!("Pixels pointer is null"); } let pixel_count = (self.width() * self.height()) as usize; std::slice::from_raw_parts_mut( pixels as *mut PreviewRgba, pixel_count, ) } } /// Sets the pixel value at the specified coordinates /// /// ## Errors /// * [`Error::OutOfRange`] - If the coordinates are outside of the image size /// * [`Error::Base`] - If an error occurs /// pub fn set_pixel( &mut self, x: u32, y: u32, value: PreviewRgba, ) -> Result<()> { unsafe { let mut pixel = std::ptr::null_mut(); if x >= self.width() || y >= self.height() { return Err(Error::OutOfRange); } sys::Imf_PreviewImage_pixel(self.0, &mut pixel, x, y) .into_result()?; *(pixel as *mut PreviewRgba) = value } Ok(()) } /// Gets the pixel value at the specified coordinates /// /// Returns [`None`] if the coordinates are outside of the image size, /// or some other error ocurred /// pub fn get_pixel(&self, x: u32, y: u32) -> Option<PreviewRgba> { unsafe { let pixel = std::ptr::null_mut(); if x >= self.width() || y >= self.height() { return None; } match sys::Imf_PreviewImage_pixel_const(self.0, pixel, x, y) .into_result() { Ok(_) => Some(*(pixel as *const PreviewRgba)), Err(_) => None, } } } } impl Clone for PreviewImage { fn clone(&self) -> Self { let mut _inner = std::ptr::null_mut(); unsafe { sys::Imf_PreviewImage_copy(&mut _inner, self.0) .into_result() .expect("Error invoking copy ctor"); } PreviewImage(_inner) } } impl Drop for PreviewImage { fn drop(&mut self) { unsafe { sys::Imf_PreviewImage_dtor(self.0); } } } /// Holds the value of a PreviewImage pixel /// /// Intensity is proportional to `pow(x/255, 2.2)` for `r`, `g`, and `b` components. #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct PreviewRgba { /// Red component of the pixel's color. /// Intensity is proportional to `pow(x/255, 2.2)`. pub r: u8, /// Green component of the pixel's color. /// Intensity is proportional to `pow(x/255, 2.2)`. pub g: u8, /// Blue component of the pixel's color. /// Intensity is proportional to `pow(x/255, 2.2)`. pub b: u8, /// The pixel's alpha. /// Transparent -> 0. Opaque -> 255. pub a: u8, } impl PreviewRgba { /// Creates a [`PreviewRgba`] from RGB and Alpha [`u8`] values /// pub fn from_u8(r: u8, g: u8, b: u8, a: u8) -> PreviewRgba { PreviewRgba { r, g, b, a } } /// Creates a [`PreviewRgba`] from RGB and Alpha [`f16`] values /// /// ## Note /// Applies gamma correction with the formula /// `clamp( pow(5.5555 * max(0, x), 0.4545) * 84.66), 0, 255)` /// pub fn from_f16(r: f16, g: f16, b: f16, a: f16) -> PreviewRgba { PreviewRgba::from_f32( f16::to_f32(r), f16::to_f32(g), f16::to_f32(b), f16::to_f32(a), ) } /// Creates a [`PreviewRgba`] from RGB and Alpha [`f32`] values /// /// ## Note /// Applies gamma correction with the formula /// `clamp( pow(5.5555 * max(0, x), 0.4545) * 84.66), 0, 255)` /// pub fn from_f32(r: f32, g: f32, b: f32, a: f32) -> PreviewRgba { PreviewRgba { r: PreviewRgba::gamma(r), g: PreviewRgba::gamma(g), b: PreviewRgba::gamma(b), a: (f32::clamp(a * 255f32, 0f32, 255f32) + 0.5f32) as u8, } } /// Creates a [`PreviewRgba`] from RGB and Alpha [`f16`] values /// /// ## Note /// Does not apply gamma correction /// pub fn from_f16_linear(r: f16, g: f16, b: f16, a: f16) -> PreviewRgba { PreviewRgba::from_f32( f16::to_f32(r), f16::to_f32(g), f16::to_f32(b), f16::to_f32(a), ) } /// Creates a [`PreviewRgba`] from RGB and Alpha [`f32`] values /// /// ## Note /// Does not apply gamma correction /// pub fn from_f32_linear(r: f32, g: f32, b: f32, a: f32) -> PreviewRgba { PreviewRgba { r: PreviewRgba::gamma(r), g: PreviewRgba::gamma(g), b: PreviewRgba::gamma(b), a: (f32::clamp(a * 255f32, 0f32, 255f32) + 0.5f32) as u8, } } /// Creates a [`PreviewRgba`] where all components have value 0 (zero) /// pub fn zero() -> PreviewRgba { PreviewRgba::from_u8(0u8, 0u8, 0u8, 0u8) } /// Convert a floating-point pixel value to an 8-bit gamma-2.2 /// preview pixel. (This routine is a simplified version of /// how the exrdisplay program transforms floating-point pixel /// values in order to display them on the screen.) /// /// ## Note /// Adapted from `previewImageExamples.cpp` /// fn gamma(linear: f32) -> u8 { let gamma = f32::powf(5.5555f32 * f32::max(0f32, linear), 0.4545f32) * 84.66f32; f32::clamp(gamma, 0f32, 255f32) as u8 } } impl From<crate::rgba::Rgba> for PreviewRgba { fn from(rgba: crate::rgba::Rgba) -> Self { PreviewRgba::from_f16(rgba.r, rgba.g, rgba.b, rgba.a) } } impl Default for PreviewRgba { fn default() -> PreviewRgba { PreviewRgba::from_u8(0u8, 0u8, 0u8, 255u8) } } #[cfg(test)] mod tests { use super::Result; use crate::core::header::Header; use crate::core::preview_image::{PreviewImage, PreviewRgba}; use crate::rgba::{ rgba::RgbaChannels, rgba_file::{RgbaInputFile, RgbaOutputFile}, }; use crate::tests::load_ferris; use half::f16; use std::path::PathBuf; #[test] fn test_empty_preview_image() -> Result<()> { PreviewImage::empty()?; Ok(()) } #[test] fn test_preview_image_with_ok_dimensions() -> Result<()> { PreviewImage::with_dimensions(0, 0)?; PreviewImage::with_dimensions(1, 1)?; PreviewImage::with_dimensions(1, 0)?; PreviewImage::with_dimensions(0, 1)?; PreviewImage::with_dimensions(8, 1)?; PreviewImage::with_dimensions(1024, 1024)?; PreviewImage::with_dimensions(4096, 4096)?; Ok(()) } #[test] fn test_preview_image_with_unsupported_dimensions() { assert!(PreviewImage::with_dimensions(std::u32::MAX, std::u32::MAX) .is_err()); } #[test] fn test_preview_image_with_pixels() -> Result<()> { const PREVIEW_WIDTH: u32 = 128; const PREVIEW_HEIGHT: u32 = 64; let pixels = [PreviewRgba::zero(); (PREVIEW_WIDTH * PREVIEW_HEIGHT) as usize]; PreviewImage::with_pixels(PREVIEW_WIDTH, PREVIEW_HEIGHT, &pixels)?; Ok(()) } #[test] fn test_clone_preview_image() -> Result<()> { const PREVIEW_WIDTH: u32 = 128; const PREVIEW_HEIGHT: u32 = 64; let pixels = [PreviewRgba::zero(); (PREVIEW_WIDTH * PREVIEW_HEIGHT) as usize]; let preview_image = PreviewImage::with_pixels(PREVIEW_WIDTH, PREVIEW_HEIGHT, &pixels)?; let _ = preview_image.clone(); Ok(()) } #[test] fn test_read_file_without_preview() -> Result<()> { let path = PathBuf::from( std::env::var("CARGO_MANIFEST_DIR") .expect("CARGO_MANIFEST_DIR not set"), ) .join("images") .join("comp_piz.exr"); let file = RgbaInputFile::new(&path, 1).unwrap(); assert_eq!(file.header().has_preview_image(), false); Ok(()) } #[test] fn test_read_file_with_preview() -> Result<()> { const PREVIEW_WIDTH: u32 = 128; const PREVIEW_HEIGHT: u32 = 85; let path = PathBuf::from( std::env::var("CARGO_MANIFEST_DIR") .expect("CARGO_MANIFEST_DIR not set"), ) .join("images") .join("ferris-preview.exr"); let file = RgbaInputFile::new(&path, 1).unwrap(); let header = file.header(); assert!(header.has_preview_image()); let preview_image = header.preview_image().unwrap(); assert_eq!(preview_image.width(), PREVIEW_WIDTH); assert_eq!(preview_image.height(), PREVIEW_HEIGHT); assert!(preview_image .pixels() .iter() .any(|&x| x != PreviewRgba::zero())); Ok(()) } #[test] fn test_preview_roundtrip() -> Result<()> { const ROUNDTRIP_FILE: &str = "preview_rtrip.exr"; const PREVIEW_WIDTH: u32 = 128; const PREVIEW_HEIGHT: u32 = 64; let (pixels, width, height) = load_ferris(); let mut preview_image = PreviewImage::with_dimensions( PREVIEW_WIDTH as u32, PREVIEW_HEIGHT as u32, )?; let preview_pixels = preview_image.mut_pixels(); for y in 0..PREVIEW_HEIGHT { for x in 0..PREVIEW_WIDTH { let pixel = &pixels[(x + PREVIEW_WIDTH * y) as usize]; preview_pixels[(x + PREVIEW_WIDTH * y) as usize] = PreviewRgba::from_f16(pixel.r, pixel.g, pixel.b, pixel.a); } } let mut header = Header::from_dimensions(width, height); header.set_preview_image(&preview_image)?; let mut output_file = RgbaOutputFile::new( ROUNDTRIP_FILE, &header, RgbaChannels::WriteRgba, 1, )?; output_file.set_frame_buffer(&pixels, 1, width as usize)?; output_file.write_pixels(height)?; std::mem::drop(output_file); let input_file = RgbaInputFile::new(ROUNDTRIP_FILE, 4)?; let header = input_file.header(); assert!(header.has_preview_image()); let preview_image = header.preview_image().unwrap(); assert_eq!(preview_image.width(), PREVIEW_WIDTH); assert_eq!(preview_image.height(), PREVIEW_HEIGHT); let preview_pixels = preview_image.pixels(); assert_eq!( preview_pixels.len(), (PREVIEW_WIDTH * PREVIEW_HEIGHT) as usize ); for y in 0..PREVIEW_HEIGHT { for x in 0..PREVIEW_WIDTH { let file_preview_pixel = &preview_pixels[(x + PREVIEW_WIDTH * y) as usize]; let pixel = &pixels[(x + PREVIEW_WIDTH * y) as usize]; let computed_preview_pixel = PreviewRgba::from_f16(pixel.r, pixel.g, pixel.b, pixel.a); assert_eq!( file_preview_pixel.r, computed_preview_pixel.r, "Red value not matching for pixel at x: {} y: {}", x, y ); assert_eq!( file_preview_pixel.g, computed_preview_pixel.g, "Green value not matching for pixel at x: {} y: {}", x, y ); assert_eq!( file_preview_pixel.b, computed_preview_pixel.b, "Blue value not matching for pixel at x: {} y: {}", x, y ); assert_eq!( file_preview_pixel.a, computed_preview_pixel.a, "Alpha value not matching for pixel at x: {} y: {}", x, y ); } } Ok(()) } #[test] fn test_preview_rgba_f32_gamma_conversion() { let preview_black = PreviewRgba::from_f32(0f32, 0f32, 0f32, 0f32); assert_eq!( preview_black.r, 0, "Mismatch red channel value on black pixel" ); assert_eq!( preview_black.g, 0, "Mismatch green channel value on black pixel" ); assert_eq!( preview_black.b, 0, "Mismatch blue channel value on black pixel" ); assert_eq!( preview_black.a, 0, "Mismatch alpha channel value on black pixel" ); let preview_white = PreviewRgba::from_f32(1f32, 1f32, 1f32, 1f32); assert_eq!( preview_white.r, 184, "Mismatch red channel value on white pixel" ); assert_eq!( preview_white.g, 184, "Mismatch green channel value on white pixel" ); assert_eq!( preview_white.b, 184, "Mismatch blue channel value on white pixel" ); assert_eq!( preview_white.a, 255, "Mismatch alpha channel value on white pixel" ); let preview_bright_white = PreviewRgba::from_f32(2.037f32, 2.037f32, 2.037f32, 1f32); assert_eq!( preview_bright_white.r, 255, "Mismatch red channel value on bright white pixel" ); assert_eq!( preview_bright_white.g, 255, "Mismatch green channel value on bright white pixel" ); assert_eq!( preview_bright_white.b, 255, "Mismatch blue channel value on bright white pixel" ); assert_eq!( preview_bright_white.a, 255, "Mismatch alpha channel value on white pixel" ); let preview_grey = PreviewRgba::from_f32(0.5f32, 0.5f32, 0.5f32, 0.5f32); assert_eq!( preview_grey.r, 134, "Mismatch red channel value on grey pixel" ); assert_eq!( preview_grey.g, 134, "Mismatch green channel value on grey pixel" ); assert_eq!( preview_grey.b, 134, "Mismatch blue channel value on grey pixel" ); assert_eq!( preview_grey.a, 128, "Mismatch alpha channel value on grey pixel" ); } #[test] fn test_preview_rgba_f16_gamma_conversion() { let preview_black = PreviewRgba::from_f16( f16::from_f32(0f32), f16::from_f32(0f32), f16::from_f32(0f32), f16::from_f32(0f32), ); assert_eq!( preview_black.r, 0, "Mismatch red channel value on black pixel" ); assert_eq!( preview_black.g, 0, "Mismatch green channel value on black pixel" ); assert_eq!( preview_black.b, 0, "Mismatch blue channel value on black pixel" ); assert_eq!( preview_black.a, 0, "Mismatch alpha channel value on black pixel" ); let preview_white = PreviewRgba::from_f16( f16::from_f32(1f32), f16::from_f32(1f32), f16::from_f32(1f32), f16::from_f32(1f32), ); assert_eq!( preview_white.r, 184, "Mismatch red channel value on white pixel" ); assert_eq!( preview_white.g, 184, "Mismatch green channel value on white pixel" ); assert_eq!( preview_white.b, 184, "Mismatch blue channel value on white pixel" ); assert_eq!( preview_white.a, 255, "Mismatch alpha channel value on white pixel" ); let preview_bright_white = PreviewRgba::from_f16( f16::from_f32(2.037f32), f16::from_f32(2.037f32), f16::from_f32(2.037f32), f16::from_f32(1f32), ); assert_eq!( preview_bright_white.r, 255, "Mismatch red channel value on bright white pixel" ); assert_eq!( preview_bright_white.g, 255, "Mismatch green channel value on bright white pixel" ); assert_eq!( preview_bright_white.b, 255, "Mismatch blue channel value on bright white pixel" ); assert_eq!( preview_bright_white.a, 255, "Mismatch alpha channel value on white pixel" ); let preview_grey = PreviewRgba::from_f16( f16::from_f32(0.5f32), f16::from_f32(0.5f32), f16::from_f32(0.5f32), f16::from_f32(0.5f32), ); assert_eq!( preview_grey.r, 134, "Mismatch red channel value on grey pixel" ); assert_eq!( preview_grey.g, 134, "Mismatch green channel value on grey pixel" ); assert_eq!( preview_grey.b, 134, "Mismatch blue channel value on grey pixel" ); assert_eq!( preview_grey.a, 128, "Mismatch alpha channel value on grey pixel" ); } }
use std::sync::Arc; use arrow::{self, datatypes::SchemaRef}; use schema::TIME_COLUMN_NAME; use snafu::{ResultExt, Snafu}; #[derive(Debug, Snafu)] pub enum Error { #[snafu(display("Error finding field column: {:?} in schema '{}'", column_name, source))] ColumnNotFoundForField { column_name: String, source: arrow::error::ArrowError, }, } pub type Result<T, E = Error> = std::result::Result<T, E>; /// Names for a field: a value field and the associated timestamp columns #[derive(Debug, PartialEq, Eq)] pub enum FieldColumns { /// All field columns share a timestamp column, named TIME_COLUMN_NAME SharedTimestamp(Vec<Arc<str>>), /// Each field has a potentially different timestamp column // (value_name, timestamp_name) DifferentTimestamp(Vec<(Arc<str>, Arc<str>)>), } impl From<Vec<Arc<str>>> for FieldColumns { fn from(v: Vec<Arc<str>>) -> Self { Self::SharedTimestamp(v) } } impl From<Vec<(Arc<str>, Arc<str>)>> for FieldColumns { fn from(v: Vec<(Arc<str>, Arc<str>)>) -> Self { Self::DifferentTimestamp(v) } } impl From<Vec<&str>> for FieldColumns { fn from(v: Vec<&str>) -> Self { let v = v.into_iter().map(Arc::from).collect(); Self::SharedTimestamp(v) } } impl From<&[&str]> for FieldColumns { fn from(v: &[&str]) -> Self { let v = v.iter().map(|v| Arc::from(*v)).collect(); Self::SharedTimestamp(v) } } /// Column indexes for a field: a value and corresponding timestamp #[derive(Debug, PartialEq, Eq, Clone)] pub struct FieldIndex { pub value_index: usize, pub timestamp_index: usize, } #[derive(Debug, PartialEq, Eq, Clone)] pub struct FieldIndexes { inner: Arc<Vec<FieldIndex>>, } impl FieldIndexes { /// Create FieldIndexes where each field has the same timestamp /// and different value index pub fn from_timestamp_and_value_indexes( timestamp_index: usize, value_indexes: &[usize], ) -> Self { value_indexes .iter() .map(|&value_index| FieldIndex { value_index, timestamp_index, }) .collect::<Vec<_>>() .into() } /// Convert a slice of pairs (value_index, time_index) into /// FieldIndexes pub fn from_slice(v: &[(usize, usize)]) -> Self { let inner = v .iter() .map(|&(value_index, timestamp_index)| FieldIndex { value_index, timestamp_index, }) .collect(); Self { inner: Arc::new(inner), } } pub fn as_slice(&self) -> &[FieldIndex] { self.inner.as_ref() } pub fn iter(&self) -> impl Iterator<Item = &FieldIndex> { self.as_slice().iter() } } impl From<Vec<FieldIndex>> for FieldIndexes { fn from(list: Vec<FieldIndex>) -> Self { Self { inner: Arc::new(list), } } } impl FieldIndexes { // look up which column index correponds to each column name pub fn names_to_indexes(schema: &SchemaRef, column_names: &[Arc<str>]) -> Result<Vec<usize>> { column_names .iter() .map(|column_name| { schema .index_of(column_name) .context(ColumnNotFoundForFieldSnafu { column_name: column_name.as_ref(), }) }) .collect() } /// Translate the field columns into pairs of (field_index, timestamp_index) pub fn from_field_columns(schema: &SchemaRef, field_columns: &FieldColumns) -> Result<Self> { let indexes = match field_columns { FieldColumns::SharedTimestamp(field_names) => { let timestamp_index = schema .index_of(TIME_COLUMN_NAME) .context(ColumnNotFoundForFieldSnafu { column_name: TIME_COLUMN_NAME, })?; Self::names_to_indexes(schema, field_names)? .into_iter() .map(|field_index| FieldIndex { value_index: field_index, timestamp_index, }) .collect::<Vec<_>>() .into() } FieldColumns::DifferentTimestamp(fields_and_timestamp_names) => { fields_and_timestamp_names .iter() .map(|(field_name, timestamp_name)| { let field_index = schema .index_of(field_name) .context(ColumnNotFoundForFieldSnafu { column_name: field_name.as_ref(), })?; let timestamp_index = schema.index_of(timestamp_name).context( ColumnNotFoundForFieldSnafu { column_name: TIME_COLUMN_NAME, }, )?; Ok(FieldIndex { value_index: field_index, timestamp_index, }) }) .collect::<Result<Vec<_>>>()? .into() } }; Ok(indexes) } }
use crate::buffer; pub struct Painter { float_offset: f32, last_frame: u32, } impl Painter { const COLOR1: u32 = 0xFF666666; const COLOR2: u32 = 0xFFEEEEEE; pub fn new() -> Painter { Painter { float_offset: 0.0, last_frame: 0, } } pub fn draw(&self, buffer: &mut buffer::Buffer) { let width = buffer.width(); Self::draw_checkerboard_pattern(buffer, width, self.offset()); } fn draw_checkerboard_pattern(buffer: &mut [u32], width: usize, offset: usize) { for (y, row) in buffer.chunks_exact_mut(width).enumerate() { for (x, pixel) in row.iter_mut().enumerate() { *pixel = if ((x + offset) + (y + offset) / 8 * 8) % 16 < 8 { Self::COLOR1 } else { Self::COLOR2 }; } } } fn offset(&self) -> usize { (self.float_offset as usize) % 8 } pub fn update_time(&mut self, time: u32) { if self.last_frame != 0 { let elapsed = time - self.last_frame; self.float_offset += (elapsed as f32) / 1000.0 * 24.0; } self.last_frame = time; } }
/* * @lc app=leetcode.cn id=51 lang=rust * * [51] N皇后 * * https://leetcode-cn.com/problems/n-queens/description/ * * algorithms * Hard (58.96%) * Total Accepted: 4.8K * Total Submissions: 8.1K * Testcase Example: '4' * * n 皇后问题研究的是如何将 n 个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击。 * * * * 上图为 8 皇后问题的一种解法。 * * 给定一个整数 n,返回所有不同的 n 皇后问题的解决方案。 * * 每一种解法包含一个明确的 n 皇后问题的棋子放置方案,该方案中 'Q' 和 '.' 分别代表了皇后和空位。 * * 示例: * * 输入: 4 * 输出: [ * ⁠[".Q..", // 解法 1 * ⁠ "...Q", * ⁠ "Q...", * ⁠ "..Q."], * * ⁠["..Q.", // 解法 2 * ⁠ "Q...", * ⁠ "...Q", * ⁠ ".Q.."] * ] * 解释: 4 皇后问题存在两个不同的解法。 * * */ extern crate log; use leetcode_rust::init_logger; use log::*; struct Solution {} const EMPTY_GRID: &str = "+ "; const QUEEN_GRID: &str = "Q "; impl Solution { pub fn dfs(v: &mut Vec<i32>, layer: i32, result: &mut Vec<Vec<String>>) { // if result.len() > 0 { // 找到一个就结束 // return; // } // info!("{:?}", v); let n = v.len() as i32; if layer == n { let res: Vec<String> = v .iter() .map(|it| { let mut s = vec![EMPTY_GRID; n as usize]; s[*it as usize] = QUEEN_GRID; let s = s.join(""); // info!("{}", s); s }) .collect(); result.push(res); return; } for num in 0..n { let mut b = false; for i in 0..layer { if v[i as usize] == num || (v[i as usize] - num).abs() == (layer - i) { b = true; break; } } if !b { v[layer as usize] = num; Solution::dfs(v, layer + 1, result); v[layer as usize] = -1; } } } pub fn solve_n_queens(n: i32) -> Vec<Vec<String>> { let mut v = vec![-1; n as usize]; let mut res: Vec<Vec<String>> = vec![]; Solution::dfs(&mut v, 0, &mut res); return res; } } fn main() { init_logger(); let result = Solution::solve_n_queens(8); info!("{}", result.len()); for (idx, res) in result.iter().enumerate() { info!("--> {}", idx + 1); for r in res { info!("{}", r); } } }
//! The BSD sockets API requires us to read the `ss_family` field before //! we can interpret the rest of a `sockaddr` produced by the kernel. #![allow(unsafe_code)] use crate::backend::c; use crate::io; use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddrAny, SocketAddrUnix, SocketAddrV4, SocketAddrV6}; use core::mem::size_of; // This must match the header of `sockaddr`. #[repr(C)] struct sockaddr_header { ss_family: u16, } /// Read the `ss_family` field from a socket address returned from the OS. /// /// # Safety /// /// `storage` must point to a valid socket address returned from the OS. #[inline] unsafe fn read_ss_family(storage: *const c::sockaddr) -> u16 { // Assert that we know the layout of `sockaddr`. let _ = c::sockaddr { __storage: c::sockaddr_storage { __bindgen_anon_1: linux_raw_sys::net::__kernel_sockaddr_storage__bindgen_ty_1 { __bindgen_anon_1: linux_raw_sys::net::__kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1 { ss_family: 0_u16, __data: [0; 126_usize], }, }, }, }; (*storage.cast::<sockaddr_header>()).ss_family } /// Set the `ss_family` field of a socket address to `AF_UNSPEC`, so that we /// can test for `AF_UNSPEC` to test whether it was stored to. #[inline] pub(crate) unsafe fn initialize_family_to_unspec(storage: *mut c::sockaddr) { (*storage.cast::<sockaddr_header>()).ss_family = c::AF_UNSPEC as _; } /// Read a socket address encoded in a platform-specific format. /// /// # Safety /// /// `storage` must point to valid socket address storage. pub(crate) unsafe fn read_sockaddr( storage: *const c::sockaddr, len: usize, ) -> io::Result<SocketAddrAny> { let offsetof_sun_path = super::addr::offsetof_sun_path(); if len < size_of::<c::sa_family_t>() { return Err(io::Errno::INVAL); } match read_ss_family(storage).into() { c::AF_INET => { if len < size_of::<c::sockaddr_in>() { return Err(io::Errno::INVAL); } let decode = &*storage.cast::<c::sockaddr_in>(); Ok(SocketAddrAny::V4(SocketAddrV4::new( Ipv4Addr::from(u32::from_be(decode.sin_addr.s_addr)), u16::from_be(decode.sin_port), ))) } c::AF_INET6 => { if len < size_of::<c::sockaddr_in6>() { return Err(io::Errno::INVAL); } let decode = &*storage.cast::<c::sockaddr_in6>(); Ok(SocketAddrAny::V6(SocketAddrV6::new( Ipv6Addr::from(decode.sin6_addr.in6_u.u6_addr8), u16::from_be(decode.sin6_port), u32::from_be(decode.sin6_flowinfo), decode.sin6_scope_id, ))) } c::AF_UNIX => { if len < offsetof_sun_path { return Err(io::Errno::INVAL); } if len == offsetof_sun_path { Ok(SocketAddrAny::Unix(SocketAddrUnix::new(&[][..])?)) } else { let decode = &*storage.cast::<c::sockaddr_un>(); // On Linux check for Linux's [abstract namespace]. // // [abstract namespace]: https://man7.org/linux/man-pages/man7/unix.7.html if decode.sun_path[0] == 0 { return SocketAddrUnix::new_abstract_name( &decode.sun_path[1..len - offsetof_sun_path], ) .map(SocketAddrAny::Unix); } // Otherwise we expect a NUL-terminated filesystem path. assert_eq!(decode.sun_path[len - 1 - offsetof_sun_path], 0); Ok(SocketAddrAny::Unix(SocketAddrUnix::new( &decode.sun_path[..len - 1 - offsetof_sun_path], )?)) } } _ => Err(io::Errno::NOTSUP), } } /// Read a socket address returned from the OS. /// /// # Safety /// /// `storage` must point to a valid socket address returned from the OS. pub(crate) unsafe fn maybe_read_sockaddr_os( storage: *const c::sockaddr, len: usize, ) -> Option<SocketAddrAny> { if len == 0 { None } else { Some(read_sockaddr_os(storage, len)) } } /// Read a socket address returned from the OS. /// /// # Safety /// /// `storage` must point to a valid socket address returned from the OS. pub(crate) unsafe fn read_sockaddr_os(storage: *const c::sockaddr, len: usize) -> SocketAddrAny { let offsetof_sun_path = super::addr::offsetof_sun_path(); assert!(len >= size_of::<c::sa_family_t>()); match read_ss_family(storage).into() { c::AF_INET => { assert!(len >= size_of::<c::sockaddr_in>()); let decode = &*storage.cast::<c::sockaddr_in>(); SocketAddrAny::V4(SocketAddrV4::new( Ipv4Addr::from(u32::from_be(decode.sin_addr.s_addr)), u16::from_be(decode.sin_port), )) } c::AF_INET6 => { assert!(len >= size_of::<c::sockaddr_in6>()); let decode = &*storage.cast::<c::sockaddr_in6>(); SocketAddrAny::V6(SocketAddrV6::new( Ipv6Addr::from(decode.sin6_addr.in6_u.u6_addr8), u16::from_be(decode.sin6_port), u32::from_be(decode.sin6_flowinfo), decode.sin6_scope_id, )) } c::AF_UNIX => { assert!(len >= offsetof_sun_path); if len == offsetof_sun_path { SocketAddrAny::Unix(SocketAddrUnix::new(&[][..]).unwrap()) } else { let decode = &*storage.cast::<c::sockaddr_un>(); // On Linux check for Linux's [abstract namespace]. // // [abstract namespace]: https://man7.org/linux/man-pages/man7/unix.7.html if decode.sun_path[0] == 0 { return SocketAddrAny::Unix( SocketAddrUnix::new_abstract_name( &decode.sun_path[1..len - offsetof_sun_path], ) .unwrap(), ); } // Otherwise we expect a NUL-terminated filesystem path. assert_eq!(decode.sun_path[len - 1 - offsetof_sun_path], 0); SocketAddrAny::Unix( SocketAddrUnix::new(&decode.sun_path[..len - 1 - offsetof_sun_path]).unwrap(), ) } } other => unimplemented!("{:?}", other), } }
use legion::*; use super::{components, config::Config, time::Time, PhysicsPipeline}; pub struct Simulation { pub world: World, pub resources: Resources, pub physics: PhysicsPipeline, } impl Simulation { pub fn new(config: Config) -> Simulation { let mut world = World::default(); let mut resources = Resources::default(); resources.insert(Time::default()); resources.insert(config); for _i in 0..config.n_cells { world.push(( components::RigidCircle::new_rand(&config), components::Color::new_rand(), )); } let physics = PhysicsPipeline::new(&mut world, &config); Simulation { world, resources, physics, } } pub fn update(&mut self) { self.resources.get_mut::<Time>().unwrap().tick(); self.physics.step(&mut self.world, &mut self.resources); } }