mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-26 14:41:04 +03:00
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:
@@ -470,10 +470,12 @@ pub async fn start_server(is_server: bool) {
|
||||
std::thread::spawn(move || {
|
||||
if let Err(err) = crate::ipc::start("") {
|
||||
log::error!("Failed to start ipc: {}", err);
|
||||
#[cfg(all(windows, feature = "flutter"))]
|
||||
if crate::is_server() && crate::ipc::test_ipc_connection().is_ok() {
|
||||
#[cfg(windows)]
|
||||
if crate::is_server() && crate::ipc::is_ipc_file_exist("").unwrap_or(false) {
|
||||
log::error!("ipc is occupied by another process, try kill it");
|
||||
crate::platform::try_kill_flutter_main_window_process();
|
||||
if let Err(e) = crate::platform::try_kill_rustdesk_main_window_process() {
|
||||
log::error!("kill failed: {}", e);
|
||||
}
|
||||
}
|
||||
std::process::exit(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user