KmError

Enum KmError 

Source
pub enum KmError {
Show 14 variants NtStatus(NtStatus), PoolAllocationFailed { size: usize, pool_type: u32, }, MdlOperationFailed { reason: &'static str, }, PhysicalMemoryFailed { address: u64, size: usize, }, VirtualMemoryFailed { address: u64, size: usize, reason: &'static str, }, ProcessOperationFailed { pid: u32, reason: &'static str, }, DeviceCreationFailed { reason: &'static str, }, SymbolicLinkFailed { reason: &'static str, }, IoctlFailed { code: u32, reason: &'static str, }, InvalidParameter { context: &'static str, }, BufferTooSmall { required: usize, provided: usize, }, AccessDenied { context: &'static str, }, InvalidAddress { address: u64, }, NotImplemented { feature: &'static str, },
}
Expand description

kernel-mode specific errors

Variants§

§

NtStatus(NtStatus)

NT status code error

§

PoolAllocationFailed

pool allocation failed

Fields

§size: usize
§pool_type: u32
§

MdlOperationFailed

MDL operation failed

Fields

§reason: &'static str
§

PhysicalMemoryFailed

physical memory access failed

Fields

§address: u64
§size: usize
§

VirtualMemoryFailed

virtual memory operation failed

Fields

§address: u64
§size: usize
§reason: &'static str
§

ProcessOperationFailed

process operation failed

Fields

§pid: u32
§reason: &'static str
§

DeviceCreationFailed

device creation failed

Fields

§reason: &'static str
§

SymbolicLinkFailed

symbolic link creation failed

Fields

§reason: &'static str
§

IoctlFailed

IOCTL operation failed

Fields

§code: u32
§reason: &'static str
§

InvalidParameter

invalid parameter

Fields

§context: &'static str
§

BufferTooSmall

buffer too small

Fields

§required: usize
§provided: usize
§

AccessDenied

access denied

Fields

§context: &'static str
§

InvalidAddress

invalid address

Fields

§address: u64
§

NotImplemented

not implemented

Fields

§feature: &'static str

Implementations§

Source§

impl KmError

Source

pub fn to_ntstatus(&self) -> NtStatus

convert to NTSTATUS for returning from driver dispatch functions

Trait Implementations§

Source§

impl Debug for KmError

Source§

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

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

impl Display for KmError

Source§

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

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

impl From<i32> for KmError

Source§

fn from(status: NtStatus) -> Self

Converts to this type from the input type.

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.