pub struct RtlHeapBox<T: ?Sized> { /* private fields */ }Expand description
A wrapper around memory that was allocated with RtlAllocateHeap and will be freed on drop with RtlFreeHeap,
like std::boxed::Box.
Implementations§
Source§impl<T> RtlHeapBox<T>
impl<T> RtlHeapBox<T>
Sourcepub unsafe fn from_raw(value: *mut T) -> Self
pub unsafe fn from_raw(value: *mut T) -> Self
Creates a new RtlHeapBox from a raw pointer.
§Safety
The caller must guarantee that the pointer was allocated with RtlAllocateHeap with the default heap of the current
process as the heap handle, returned by GetProcessHeap.
The caller must not allow this pointer to be aliased anywhere else. Conceptually, by calling from_raw, the caller
must guarantee that ownership of the pointer value is transferred to this RtlHeapBox. This is to uphold the aliasing
requirements used by RtlHeapBox to implement various Deref and AsRef traits.
On drop, this memory will be freed with RtlFreeHeap. The caller must not manually free this pointer.