judge failure of get_current_process_session_id with None rather than 0 (#7188)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
a8eff641b2
commit
58ddac63d2
@ -1194,6 +1194,7 @@ impl Connection {
|
||||
.into();
|
||||
|
||||
let mut sub_service = false;
|
||||
#[allow(unused_mut)]
|
||||
let mut wait_session_id_confirm = false;
|
||||
#[cfg(windows)]
|
||||
self.handle_windows_specific_session(&mut pi, &mut wait_session_id_confirm);
|
||||
@ -1303,12 +1304,11 @@ impl Connection {
|
||||
wait_session_id_confirm: &mut bool,
|
||||
) {
|
||||
let sessions = crate::platform::get_available_sessions(true);
|
||||
let current_sid = crate::platform::get_current_process_session_id().unwrap_or_default();
|
||||
if let Some(current_sid) = crate::platform::get_current_process_session_id() {
|
||||
if crate::platform::is_installed()
|
||||
&& crate::platform::is_share_rdp()
|
||||
&& raii::AuthedConnID::remote_and_file_conn_count() == 1
|
||||
&& sessions.len() > 1
|
||||
&& current_sid != 0
|
||||
&& (get_version_number(&self.lr.version) > get_version_number("1.2.4")
|
||||
|| self.lr.option.support_windows_specific_session == BoolOption::Yes.into())
|
||||
{
|
||||
@ -1321,6 +1321,7 @@ impl Connection {
|
||||
*wait_session_id_confirm = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn on_remote_authorized(&self) {
|
||||
self.update_codec_on_login();
|
||||
@ -2283,15 +2284,15 @@ impl Connection {
|
||||
.user_record(self.inner.id(), status),
|
||||
#[cfg(windows)]
|
||||
Some(misc::Union::SelectedSid(sid)) => {
|
||||
let current_process_usid =
|
||||
crate::platform::get_current_process_session_id().unwrap_or_default();
|
||||
if let Some(current_process_sid) =
|
||||
crate::platform::get_current_process_session_id()
|
||||
{
|
||||
let sessions = crate::platform::get_available_sessions(false);
|
||||
if crate::platform::is_installed()
|
||||
&& crate::platform::is_share_rdp()
|
||||
&& raii::AuthedConnID::remote_and_file_conn_count() == 1
|
||||
&& sessions.len() > 1
|
||||
&& current_process_usid != 0
|
||||
&& current_process_usid != sid
|
||||
&& current_process_sid != sid
|
||||
&& sessions.iter().any(|e| e.sid == sid)
|
||||
{
|
||||
std::thread::spawn(move || {
|
||||
@ -2307,6 +2308,7 @@ impl Connection {
|
||||
self.try_sub_services();
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
Some(message::Union::AudioFrame(frame)) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user