Merge pull request #4386 from fufesou/feat/plugin_framework

Feat/plugin framework
This commit is contained in:
RustDesk
2023-05-16 15:26:04 +08:00
committed by GitHub
4 changed files with 210 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
use hbb_common::{libc, log, ResultType};
use hbb_common::{bail, libc, log, ResultType};
#[cfg(target_os = "windows")]
use std::env;
use std::{
@@ -146,6 +146,10 @@ fn get_uninstall_file_path() -> ResultType<PathBuf> {
#[inline]
fn cstr_to_string(cstr: *const c_char) -> ResultType<String> {
assert!(!cstr.is_null(), "cstr must be a valid pointer");
if cstr.is_null() {
bail!("failed to convert string, the pointer is null");
}
Ok(String::from_utf8(unsafe {
CStr::from_ptr(cstr).to_bytes().to_vec()
})?)