pub struct Driver { /* private fields */ }Expand description
A minifilter is identified by a port (know in advance), like a named pipe used for communication,
and a handle, retrieved by open_kernel_driver_com.
Implementations§
Source§impl Driver
impl Driver
Sourcepub fn close_kernel_communication(&self) -> bool
pub fn close_kernel_communication(&self) -> bool
Can be used to properly close the communication (and unregister) with the minifilter. If this fn is not used and the program has stopped, the handle is automatically closed, seemingly without any side-effects.
Sourcepub fn driver_set_app_pid(&self) -> Result<(), Error>
pub fn driver_set_app_pid(&self) -> Result<(), Error>
Sourcepub fn open_kernel_driver_com() -> Result<Self, Error>
pub fn open_kernel_driver_com() -> Result<Self, Error>
Try to open a com canal with the minifilter before this app is registered.
§Panics
This function will panic if the minifilter port has any nul value (except the last one) in it’s name.
§Errors
This fn can fail is the minifilter is unreachable:
- if it is not started (try
sc start snFilterfirst - if a connection is already established: it can accepts only one at a time.
In that case the Error is raised by the OS (windows::Error) and is generally readable.
Sourcepub fn get_irp(&self, vecnew: &mut Vec<u8>) -> Option<ReplyIrp>
pub fn get_irp(&self, vecnew: &mut Vec<u8>) -> Option<ReplyIrp>
Ask the driver for a ReplyIrp, if any. This is a low-level function and the returned object
uses C pointers. Managing C pointers requires a special care, because of the Rust timelines.
ReplyIrp is optional since the minifilter returns null if there is no new activity.
§Panics
This fn panics if it is unable to get the current pid or cannot get driver message from the minifilter.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Driver
impl RefUnwindSafe for Driver
impl Send for Driver
impl Sync for Driver
impl Unpin for Driver
impl UnwindSafe for Driver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more