Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rustdesk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李朝发
rustdesk
Commits
0503a4d5
Commit
0503a4d5
authored
Apr 07, 2021
by
rustdesk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix failure to get_active_username in non-EN windows
parent
8873bce5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
windows.rs
src/platform/windows.rs
+9
-8
remote.rs
src/ui/remote.rs
+1
-1
No files found.
src/platform/windows.rs
View file @
0503a4d5
...
...
@@ -634,19 +634,20 @@ fn get_error() -> String {
}
pub
fn
get_active_username
()
->
String
{
use
std
::
os
::
windows
::
process
::
CommandExt
;
let
name
=
crate
::
username
();
if
name
!=
"SYSTEM"
{
return
name
;
}
if
let
Ok
(
output
)
=
std
::
process
::
Command
::
new
(
"query"
)
.arg
(
"user"
)
.output
()
{
const
CREATE_NO_WINDOW
:
u32
=
0x08000000
;
let
mut
cmd
=
std
::
process
::
Command
::
new
(
"query"
);
cmd
.arg
(
"user"
);
cmd
.creation_flags
(
CREATE_NO_WINDOW
);
if
let
Ok
(
output
)
=
cmd
.output
()
{
for
line
in
String
::
from_utf8_lossy
(
&
output
.stdout
)
.lines
()
{
if
line
.contains
(
"Active"
)
{
if
let
Some
(
name
)
=
line
.split_whitespace
()
.next
()
{
if
name
.starts_with
(
">"
)
{
return
name
.replace
(
">"
,
""
);
}
else
{
return
name
.to_string
();
}
}
}
}
...
...
src/ui/remote.rs
View file @
0503a4d5
...
...
@@ -1582,7 +1582,7 @@ impl Interface for Handler {
pi_sciter
.set_item
(
"sas_enabled"
,
pi
.sas_enabled
);
if
self
.is_file_transfer
()
{
if
pi
.username
.is_empty
()
{
self
.on_error
(
"No active
console
user logged on, please connect and logon first."
);
self
.on_error
(
"No active user logged on, please connect and logon first."
);
return
;
}
}
else
if
!
self
.is_port_forward
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment