mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-26 14:41:04 +03:00
@@ -580,11 +580,11 @@ async fn launch_server(session_id: DWORD, close_first: bool) -> ResultType<HANDL
|
||||
Ok(h)
|
||||
}
|
||||
|
||||
pub fn run_as_user(arg: &str) -> ResultType<Option<std::process::Child>> {
|
||||
pub fn run_as_user(arg: Vec<&str>) -> ResultType<Option<std::process::Child>> {
|
||||
let cmd = format!(
|
||||
"\"{}\" {}",
|
||||
std::env::current_exe()?.to_str().unwrap_or(""),
|
||||
arg,
|
||||
arg.join(" "),
|
||||
);
|
||||
let session_id = unsafe { get_current_session(share_rdp()) };
|
||||
use std::os::windows::ffi::OsStrExt;
|
||||
@@ -596,7 +596,7 @@ pub fn run_as_user(arg: &str) -> ResultType<Option<std::process::Child>> {
|
||||
let h = unsafe { LaunchProcessWin(wstr, session_id, TRUE) };
|
||||
if h.is_null() {
|
||||
bail!(
|
||||
"Failed to launch {} with session id {}: {}",
|
||||
"Failed to launch {:?} with session id {}: {}",
|
||||
arg,
|
||||
session_id,
|
||||
get_error()
|
||||
|
||||
Reference in New Issue
Block a user