-
Notifications
You must be signed in to change notification settings - Fork 584
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
I've been looking around at supporting VARIANT.
I had a bit of trouble but found a good way to deal with BSTR. It contains a pointer in mem and therefore the VARIANT_0_0_0 member for it is a ManuallyDrop
Anonymous: VARIANT_0_0_0 {
bstrVal: ManuallyDrop::new(
// When made this way, the BSTR will have memory created in windows
// so we don't have to maintain a ref to the original data.
match BSTR::from_wide(&value) {
Ok(b) => b,
Err(err) => return Err(err),
}
),
},You can see that in the drop for BSTR the memory is deallocated from windows.
I started looking at DECIMAL support in VARIANT_0_0_0 and it looks like it takes a pointer to a DECIMAL
I would have expected it to take some kind of ManuallyDrop<DECIMAL_WRAPPER> that surrounds a pointer to the innards.
If I get a VARIANT of this type as a result of a COM call, do I need to worry about the pointer to the DECIMAL? Who owns that memory? How does it get cleaned up?
Crate manifest
No response
Crate code
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request