pub struct SecurityDescriptor { /* private fields */ }Expand description
An owned, self-relative copy of a caller’s security descriptor.
Whatever form the caller supplied, this holds the self-relative form in one contiguous, DWORD-aligned blob, so it names nothing outside itself and can be carried to another thread.
Implementations§
Source§impl SecurityDescriptor
impl SecurityDescriptor
Sourcepub unsafe fn capture(
descriptor: *const c_void,
) -> Result<Self, SecurityCaptureError>
pub unsafe fn capture( descriptor: *const c_void, ) -> Result<Self, SecurityCaptureError>
Captures the descriptor at descriptor.
An absolute descriptor is converted to self-relative form; a self-relative one is copied as it stands. Either way the result owns every byte it refers to.
§Errors
Returns a SecurityCaptureError when Windows rejects the descriptor
as malformed, or when the conversion fails.
§Safety
descriptor must be non-null and point to a security descriptor that
stays valid for the duration of this call, including everything an
absolute descriptor points at.
Sourcepub fn as_ptr(&self) -> *const c_void
pub fn as_ptr(&self) -> *const c_void
The captured descriptor’s address, for handing to a Win32 call.
The pointer borrows from this value and must not outlive it.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the captured descriptor is empty, which a valid one never is.
Sourcepub fn dacl(&self) -> Result<AclState, SecurityCaptureError>
pub fn dacl(&self) -> Result<AclState, SecurityCaptureError>
What the descriptor says about its discretionary access-control list.
§Errors
Returns a SecurityCaptureError if Windows will not report the list,
which a descriptor that validated at capture should not do.
Trait Implementations§
Source§impl Clone for SecurityDescriptor
impl Clone for SecurityDescriptor
Source§fn clone(&self) -> SecurityDescriptor
fn clone(&self) -> SecurityDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more