portable service

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-11-10 10:27:13 +08:00
parent eb60ab0b79
commit 8e1545b432
46 changed files with 1217 additions and 72 deletions

View File

@@ -63,7 +63,7 @@ pub fn get_cursor() -> ResultType<Option<u64>> {
unsafe {
let mut ci: CURSORINFO = mem::MaybeUninit::uninit().assume_init();
ci.cbSize = std::mem::size_of::<CURSORINFO>() as _;
if GetCursorInfo(&mut ci) == FALSE {
if crate::portable_service::client::get_cursor_info(&mut ci) == FALSE {
return Err(io::Error::last_os_error().into());
}
if ci.flags & CURSOR_SHOWING == 0 {
@@ -1542,9 +1542,11 @@ pub fn elevate_or_run_as_system(is_setup: bool, is_elevate: bool, is_run_as_syst
} else {
"--run-as-system"
};
if is_root() {
log::debug!("portable run as system user");
if is_run_as_system {
log::info!("run portable service");
crate::portable_service::server::run_portable_service();
}
} else {
match is_elevated(None) {
Ok(elevated) => {