Skip to main content

ObjectType

Struct ObjectType 

Source
pub struct ObjectType(/* private fields */);
Expand description

The kind of object a handle names, which GetSecurityInfo needs to know to find its security.

A newtype over SE_OBJECT_TYPE, because Windows defines more kinds than are named here and this crate removes none of them. get_security_info passes only the kinds reads_any_handle names; get_security_info_unchecked takes every kind, from a caller who knows the kind of the object the handle names.

§Example

use win_authorization_sys::ObjectType;

assert_ne!(ObjectType::FILE, ObjectType::KERNEL_OBJECT);
assert_eq!(ObjectType::from_raw(ObjectType::FILE.as_raw()), ObjectType::FILE);

Implementations§

Source§

impl ObjectType

Source

pub const UNKNOWN: Self

SE_UNKNOWN_OBJECT_TYPE.

Source

pub const FILE: Self

SE_FILE_OBJECT: a file or directory, or a named pipe or other object a file handle names.

Source

pub const SERVICE: Self

SE_SERVICE: a Windows service.

Source

pub const PRINTER: Self

SE_PRINTER: a printer.

Source

pub const REGISTRY_KEY: Self

SE_REGISTRY_KEY: a registry key.

Source

pub const LMSHARE: Self

SE_LMSHARE: a network share.

Source

pub const KERNEL_OBJECT: Self

SE_KERNEL_OBJECT: a kernel object that has no kind of its own here, such as an event, a mutex, a semaphore, a process or a thread.

Source

pub const WINDOW_OBJECT: Self

SE_WINDOW_OBJECT: a window station or desktop.

Source

pub const DS_OBJECT: Self

SE_DS_OBJECT: a directory service object.

Source

pub const DS_OBJECT_ALL: Self

SE_DS_OBJECT_ALL: a directory service object and its properties.

Source

pub const PROVIDER_DEFINED: Self

SE_PROVIDER_DEFINED_OBJECT: an object of a provider’s own kind.

Source

pub const WMIGUID: Self

SE_WMIGUID_OBJECT: a WMI object.

Source

pub const REGISTRY_WOW64_32KEY: Self

SE_REGISTRY_WOW64_32KEY: a registry key in the 32-bit view.

Source

pub const REGISTRY_WOW64_64KEY: Self

SE_REGISTRY_WOW64_64KEY: a registry key in the 64-bit view.

Source

pub const fn from_raw(raw: SE_OBJECT_TYPE) -> Self

A kind from its Win32 value.

Source

pub const fn as_raw(self) -> SE_OBJECT_TYPE

The kind’s Win32 value.

Source

pub const fn reads_any_handle(self) -> bool

Whether get_security_info passes this kind with a handle of any kind: the kinds under which Windows was measured reading the security of the handle it is given, whatever the handle names, and UNKNOWN, which it refuses with its own code. Every other kind is for get_security_info_unchecked.

Trait Implementations§

Source§

impl Clone for ObjectType

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ObjectType

Source§

impl Debug for ObjectType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ObjectType

Source§

impl Hash for ObjectType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ObjectType

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ObjectType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.