From 4f60dc952268789814010468df5e3355904e3d03 Mon Sep 17 00:00:00 2001 From: fufesou Date: Tue, 7 Mar 2023 20:29:44 +0800 Subject: [PATCH] win,debug Signed-off-by: fufesou --- .github/workflows/flutter-nightly.yml | 2 +- build.py | 6 ------ src/platform/windows.rs | 10 +++++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index c9aa01a83..2a1254e23 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -86,7 +86,7 @@ jobs: shell: bash - name: Build rustdesk - run: python3 .\build.py --portable --hwcodec --flutter --idd-driver + run: python3 .\build.py --portable --hwcodec --flutter --feature IddDriver - name: Sign rustdesk files uses: GermanBluefox/code-sign-action@v7 diff --git a/build.py b/build.py index d7e6e0edf..45fe1b132 100755 --- a/build.py +++ b/build.py @@ -106,12 +106,6 @@ def make_parser(): action='store_true', help='Skip cargo build process, only flutter version + Linux supported currently' ) - if windows: - parser.add_argument( - '--idd-driver', - action='store_true', - help='Build idd driver for virtual display.' - ) return parser diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 11a8ee53f..22896e65b 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -1908,7 +1908,7 @@ pub fn user_accessible_folder() -> ResultType { } mod cert { - use hbb_common::{bail, log, ResultType}; + use hbb_common::{allow_err, bail, log, ResultType}; use std::{path::Path, str::from_utf8}; use winapi::shared::{ minwindef::{BYTE, DWORD, TRUE}, @@ -1946,7 +1946,7 @@ mod cert { &mut size, ) == TRUE { - (thumbprint.to_vec(), hex::encode(thumbprint)) + (thumbprint.to_vec(), hex::encode(thumbprint).to_ascii_uppercase()) } else { (thumbprint.to_vec(), "".to_owned()) } @@ -1988,7 +1988,7 @@ mod cert { log::debug!("Thumbprint of cert {}", &thumbprint.1); let reg_cert_key = open_reg_cert_store()?; - let (cert_key, _) = reg_cert_key.create_subkey(&thumbprint.1.to_ascii_uppercase())?; + let (cert_key, _) = reg_cert_key.create_subkey(&thumbprint.1)?; let data = winreg::RegValue { vtype: REG_BINARY, bytes: create_cert_blob(thumbprint.0, cert_bytes), @@ -2021,7 +2021,7 @@ mod cert { buf.len() as _, ); if cb_size != 1 { - if let Ok(issuer) = from_utf8(&buf) { + if let Ok(issuer) = from_utf8(&buf[..cb_size as _]) { for iss in issuers_to_rm.iter() { if issuer.contains(iss) { let (_, thumbprint) = compute_thumbprint( @@ -2047,7 +2047,7 @@ mod cert { let thumbprints = get_thumbprints_to_rm()?; let reg_cert_key = unsafe { open_reg_cert_store()? }; for thumbprint in thumbprints.iter() { - reg_cert_key.delete_subkey(&hex::encode(thumbprint)).ok(); + allow_err!(reg_cert_key.delete_subkey(thumbprint)); } Ok(()) }