From 68560da7fe2229c32da0f52689b1f78730974bed Mon Sep 17 00:00:00 2001 From: Matt Ehrnschwender Date: Sun, 25 Feb 2024 18:05:05 -0500 Subject: [PATCH] Fix Windows test errors --- .../thanatos/agent/thanatos/src/os/windows/mod.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Payload_Type/thanatos/agent/thanatos/src/os/windows/mod.rs b/Payload_Type/thanatos/agent/thanatos/src/os/windows/mod.rs index 35d95d0..22607dd 100644 --- a/Payload_Type/thanatos/agent/thanatos/src/os/windows/mod.rs +++ b/Payload_Type/thanatos/agent/thanatos/src/os/windows/mod.rs @@ -1,12 +1,23 @@ use errors::ThanatosError; -use ffiwrappers::windows::processthreadsapi::token::CurrentToken; -pub use ffiwrappers::windows::{domain, hostname, sysinfoapi, username}; +use ffiwrappers::windows::{processthreadsapi::token::CurrentToken, sysinfoapi}; mod platform; pub use platform::{build_number, product}; use crate::proto::checkin::Architecture; +pub fn username() -> Result { + ffiwrappers::windows::username().map_err(ThanatosError::FFIError) +} + +pub fn hostname() -> Result { + ffiwrappers::windows::hostname().map_err(ThanatosError::FFIError) +} + +pub fn domain() -> Result { + ffiwrappers::windows::domain().map_err(ThanatosError::FFIError) +} + pub fn process_name() -> Result { ffiwrappers::windows::process_name().map_err(ThanatosError::FFIError) }