Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(host): devolutions-session bootstrap #997

Merged
merged 10 commits into from
Sep 9, 2024
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ members = [
"crates/*",
"devolutions-agent",
"devolutions-gateway",
"devolutions-host",
"jetsocat",
"tools/generate-openapi",
]
default-members = [
"devolutions-agent",
"devolutions-gateway",
"devolutions-agent",
"devolutions-host",
"jetsocat",
]

Expand Down
15 changes: 8 additions & 7 deletions ci/tlk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function Get-DestinationSymbolFile {

$DestinationSymbolsName = $(Split-Path $DestinationExecutable -LeafBase) + ".$($Target.SymbolsExtension)"
$DestinationDirectory = Split-Path $DestinationExecutable -Parent

Join-Path $DestinationDirectory $DestinationSymbolsName
}

Expand Down Expand Up @@ -345,6 +345,7 @@ class TlkRecipe
if ($this.Target.IsWindows()) {
$agentPackages += [TlkPackage]::new("devolutions-pedm-hook", "crates/devolutions-pedm-hook", $true)
$agentPackages += [TlkPackage]::new("devolutions-pedm-shell-ext", "crates/devolutions-pedm-shell-ext", $true)
$agentPackages += [TlkPackage]::new("devolutions-host", "devolutions-host", $false)
}

$agentPackages
Expand Down Expand Up @@ -405,13 +406,13 @@ class TlkRecipe
$CargoPackages = $this.CargoPackages()
$CargoTarget = $this.Target.CargoTarget()
$CargoProfile = $this.Target.CargoProfile

$CargoOutputPath = "$($this.SourcePath)/target/${CargoTarget}/${CargoProfile}"

foreach ($CargoPackage in $CargoPackages) {
Push-Location
Set-Location -Path $CargoPackage.Path

$this.Cargo(@('build'))

$SrcBinaryPath = "${CargoOutputPath}/$($CargoPackage.BinaryFileName($this.Target))"
Expand Down Expand Up @@ -455,10 +456,10 @@ class TlkRecipe
if (Test-Path Env:STRIP_EXECUTABLE) {
$StripExecutable = $Env:STRIP_EXECUTABLE
}

& $StripExecutable $SrcBinaryPath | Out-Host
}

if ($DestinationExecutable) {
Copy-Item -Path $SrcBinaryPath -Destination $DestinationExecutable
}
Expand All @@ -472,7 +473,7 @@ class TlkRecipe

Push-Location
Set-Location $CargoOutputPath

$MakeAppxOutput = & 'MakeAppx.exe' 'pack' '/f' "${CargoPackagePath}/mapping.txt" '/p' "./DevolutionsPedmShellExt.msix" '/nv' '/o'
if (!$?) {
throw "MakeAppx package creation failed: ${MakeAppxOutput}"
Expand All @@ -497,7 +498,7 @@ class TlkRecipe

Copy-Item -Path $builtDesktopExe -Destination $Env:DAGENT_PEDM_DESKTOP_EXECUTABLE
Copy-Item -Path $builtDesktopPdb -Destination $(Get-DestinationSymbolFile $Env:DAGENT_PEDM_DESKTOP_EXECUTABLE $this.Target)

}
}

Expand Down
6 changes: 4 additions & 2 deletions crates/win-api-wrappers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ publish = false
base16ct = { version = "0.2.0", features = ["alloc"] }
anyhow = "1.0.86"
thiserror = "1.0.63"
tracing = "0.1"

[dependencies.windows]
version = "0.58.0"
features = [
"Win32_Foundation",
"Win32_NetworkManagement_NetManagement",
"Win32_Security",
"Win32_Security_Authentication_Identity",
"Win32_Security_Authorization",
"Win32_Security_Cryptography",
"Win32_Security_Cryptography_Catalog",
"Win32_Security_Cryptography_Sip",
"Win32_Security_Cryptography",
"Win32_Security_WinTrust",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_Com",
"Win32_System_Diagnostics_Debug",
Expand All @@ -38,6 +39,7 @@ features = [
"Win32_System_Pipes",
"Win32_System_ProcessStatus",
"Win32_System_Registry",
"Win32_System_RemoteDesktop",
"Win32_System_Rpc",
"Win32_System_StationsAndDesktops",
"Win32_System_SystemServices",
Expand Down
3 changes: 1 addition & 2 deletions crates/win-api-wrappers/src/handle.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::fmt::Debug;
use std::os::windows::io::{AsRawHandle, BorrowedHandle, IntoRawHandle, OwnedHandle};

use windows::Win32::Foundation::E_HANDLE;
use windows::Win32::Foundation::{CloseHandle, DuplicateHandle, DUPLICATE_SAME_ACCESS, HANDLE};
use windows::Win32::Foundation::{CloseHandle, DuplicateHandle, DUPLICATE_SAME_ACCESS, E_HANDLE, HANDLE};
use windows::Win32::System::Threading::GetCurrentProcess;

// TODO: Use/implement AsHandle and AsRawHandle as appropriate
Expand Down
4 changes: 4 additions & 0 deletions crates/win-api-wrappers/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[macro_use]
extern crate tracing;

#[cfg(target_os = "windows")]
#[path = ""]
mod lib_win {
Expand All @@ -8,6 +11,7 @@ mod lib_win {
pub mod identity;
pub mod process;
pub mod security;
pub mod session;
pub mod thread;
pub mod token;
pub mod utils;
Expand Down
Loading