fix kill occupied ipc process, find with enumerate, kill with NtTerminateProcess (#8289)

* I reproduced the issue, that process did't have title, couldn't be connected
  to and taskkill not work
* Test whether ipc is opccupied with enumerating named pipe
* With NtTerminateProcess, it was killed successfully.
* There is a way to find the exact process which occupy the ipc, I have
  not check it, it's from https://github.com/winsiderss/systeminformer

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-06-08 14:09:16 +08:00
committed by GitHub
parent 987da00be0
commit 0bb537b872
5 changed files with 112 additions and 48 deletions

View File

@@ -1700,6 +1700,15 @@ pub fn read_custom_client(config: &str) {
}
}
#[inline]
pub fn is_empty_uni_link(arg: &str) -> bool {
let prefix = crate::get_uri_prefix();
if !arg.starts_with(&prefix) {
return false;
}
arg[prefix.len()..].chars().all(|c| c == '/')
}
#[cfg(test)]
mod tests {
use super::*;