#![allow(non_camel_case_types, non_snake_case)]
use crate::decl::*;
use crate::kernel::privs::*;
use crate::ole::{privs::*, vts::*};
use crate::prelude::*;
com_interface! { IBindCtx: "0000000e-0000-0000-c000-000000000046";
}
impl ole_IBindCtx for IBindCtx {}
pub trait ole_IBindCtx: ole_IUnknown {
#[must_use]
fn GetBindOptions(&self) -> HrResult<BIND_OPTS3<'_, '_, '_, '_, '_, '_, '_, '_>> {
let mut bo = BIND_OPTS3::default();
HrRet(unsafe { (vt::<IBindCtxVT>(self).GetBindOptions)(self.ptr(), pvoid(&mut bo)) })
.to_hrresult()
.map(|_| bo)
}
#[must_use]
fn GetObjectParam<T>(&self, key: &str) -> HrResult<T>
where
T: ole_IUnknown,
{
let mut queried = unsafe { T::null() };
HrRet(unsafe {
(vt::<IBindCtxVT>(self).GetObjectParam)(
self.ptr(),
WString::from_str(key).as_ptr(),
queried.as_mut(),
)
})
.to_hrresult()
.map(|_| queried)
}
fn_com_noparm! { ReleaseBoundObjects: IBindCtxVT;
}
fn RevokeObjectParam(&self, key: &str) -> HrResult<()> {
HrRet(unsafe {
(vt::<IBindCtxVT>(self).RevokeObjectParam)(self.ptr(), WString::from_str(key).as_ptr())
})
.to_hrresult()
}
}