pub trait IAllocator: IUnknown {
// Required methods
unsafe fn alloc_bstr(&self, text: *const u16, len: u32) -> BSTR;
unsafe fn free_bstr(&self, bstr: BSTR);
unsafe fn alloc(&self, len: usize) -> *mut c_void;
unsafe fn free(&self, ptr: *mut c_void);
}Required Methods§
Sourceunsafe fn alloc_bstr(&self, text: *const u16, len: u32) -> BSTR
unsafe fn alloc_bstr(&self, text: *const u16, len: u32) -> BSTR
Allocates a new BSTR based on an existing string value.
§Arguments
psz- A pointer to an existing wide character (16-bit) string.len- String length.
§Safety
The function is safe to call as long as the psz is valid in relation
to the given len. The returned value must be freed using BSTR aware
free function, such as the free_bstr in this interface or the
SysFreeString function on Windows.
Trait Implementations§
Source§impl ComClassInterface<dyn IAllocator, AutomationTypeSystem> for Allocator
impl ComClassInterface<dyn IAllocator, AutomationTypeSystem> for Allocator
Source§impl ComClassInterface<dyn IAllocator, RawTypeSystem> for Allocator
impl ComClassInterface<dyn IAllocator, RawTypeSystem> for Allocator
Source§impl ComInterface for dyn IAllocator
impl ComInterface for dyn IAllocator
Source§fn iid_ts<TS: TypeSystem>() -> &'static IIDwhere
Self: ComInterfaceVariant<TS>,
fn iid_ts<TS: TypeSystem>() -> &'static IIDwhere
Self: ComInterfaceVariant<TS>,
Returns the IID of the requested interface.
Source§type TSelf = dyn IAllocator
type TSelf = dyn IAllocator
The current interface. Read more