mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-21 04:01:01 +03:00
flutter windows main.cpp get app name from rust (#7316)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -154,6 +154,17 @@ pub unsafe extern "C" fn free_c_args(ptr: *mut *mut c_char, len: c_int) {
|
||||
// Afterwards the vector will be dropped and thus freed.
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn get_rustdesk_app_name(buffer: *mut u16, length: i32) -> i32 {
|
||||
let name = crate::platform::wide_string(&crate::get_app_name());
|
||||
if length > name.len() as i32 {
|
||||
std::ptr::copy_nonoverlapping(name.as_ptr(), buffer, name.len());
|
||||
return 0;
|
||||
}
|
||||
-1
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct SessionHandler {
|
||||
event_stream: Option<StreamSink<EventToUI>>,
|
||||
|
||||
Reference in New Issue
Block a user