[][src]Struct nt_native::Handle

pub struct Handle(_);

Methods

impl Handle[src]

pub const fn invalid() -> Handle[src]

pub const fn new(handle: HANDLE) -> Handle[src]

Takes ownership of the raw OS handle

pub fn is_valid(&self) -> bool[src]

pub fn close(&mut self) -> Result<()>[src]

pub fn object_name(&self) -> Result<NtString>[src]

Returns full object name. For files it would be something like \Device\HarddiskVolume3\RootDir\Dir\file.ext

Warning: this call uses well-known, but Undocumented structure!

pub fn remove_object(self) -> Result<()>[src]

ShareAccess::DELETE flag should be set.

Warning: the file will be deleted immediately after the call! The system will not wait until the last HANDLE to the file is closed.

impl Handle[src]

pub fn ioctl<I: AsByteSlice, O: AsByteSliceMut>(
    &self,
    code: u32,
    input: &I,
    output: &mut O
) -> Result<()>
[src]

pub fn ioctl_status(&self, code: u32) -> NTSTATUS[src]

pub fn ioctl_query<T: AsByteSliceMut>(
    &self,
    code: u32,
    output: &mut T
) -> Result<()>
[src]

pub fn ioctl_same_buffer<T: Sized>(
    &self,
    code: u32,
    buffer: &mut T
) -> Result<()>
[src]

pub fn ioctl_raw(
    &self,
    code: u32,
    in_buffer: &[u8],
    out_buffer: &mut [u8]
) -> (NTSTATUS, usize)
[src]

impl Handle[src]

pub fn write(&self, data: &[u8], pos: Option<u64>) -> Result<usize>[src]

pub fn read(&self, buffer: &mut [u8], pos: Option<u64>) -> Result<usize>[src]

pub fn flush(&self) -> Result<()>[src]

Trait Implementations

impl AsRawHandle for Handle[src]

impl Clone for Handle[src]

impl Debug for Handle[src]

impl Drop for Handle[src]

impl From<Handle> for File[src]

impl From<Handle> for Volume[src]

impl From<Handle> for Disk[src]

impl FromRawHandle for Handle[src]

impl IntoRawHandle for Handle[src]

impl Read for Handle[src]

impl Send for Handle[src]

impl Sync for Handle[src]

impl Write for Handle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.