implement process modules
This commit is contained in:
@@ -21,7 +21,7 @@ impl Drop for Handle {
|
||||
if self.0 != INVALID_HANDLE_VALUE {
|
||||
unsafe {
|
||||
if let Err(why) = CloseHandle(**self) {
|
||||
eprintln!("couldn't close handle: {why}");
|
||||
eprintln!("failed to close handle: {why}");
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -35,13 +35,13 @@ impl Handle {
|
||||
.or_else(|_| OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE, false, pid))
|
||||
.map_err(|why| {
|
||||
crate::Error::HandleError(format!(
|
||||
"couldn't open process with needed access: {why}",
|
||||
"failed to open process with needed access: {why}",
|
||||
))
|
||||
})?
|
||||
};
|
||||
if handle == INVALID_HANDLE_VALUE {
|
||||
return Err(crate::Error::HandleError(
|
||||
"couldn't get a valid handle".to_string(),
|
||||
"failed to get a valid handle".to_string(),
|
||||
));
|
||||
}
|
||||
Ok(Self(handle))
|
||||
|
||||
Reference in New Issue
Block a user