Skip to content

Commit 30224e5

Browse files
committed
OrcCommand: WolfLauncher: Outcome: set outcome.computer_name with /FullComputer
Or fallback on /Computer then host's.
1 parent 6e3b793 commit 30224e5

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/OrcCommand/Command/WolfLauncher/Outcome.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ Orc::Result<void> Write(const Outcome& outcome, StructuredOutputWriter::IWriter:
375375
writer->WriteNamed(L"end", *endingTime);
376376
}
377377

378-
writer->WriteNamed(L"computer_name", outcome.GetComputerNameValue());
378+
writer->WriteNamed(L"computer_name", outcome.GetOrcComputerNameValue());
379379

380380
::Write(writer, outcome.GetMothership());
381381

src/OrcCommand/Command/WolfLauncher/Outcome.h

+4
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ class Outcome
407407
const std::wstring& GetComputerNameValue() const { return m_computerName; }
408408
void SetComputerNameValue(std::wstring name) { m_computerName = std::move(name); }
409409

410+
const std::wstring& GetOrcComputerNameValue() const { return m_orcComputerName; }
411+
void SetOrcComputerNameValue(std::wstring name) { m_orcComputerName = std::move(name); }
412+
410413
// Timestamp is used as a unique identifier between orc execution and multiple files
411414
std::wstring GetTimestampKey() const { return m_timestamp; }
412415
void SetTimestampKey(const std::wstring& timestamp) { m_timestamp = timestamp; }
@@ -439,6 +442,7 @@ class Outcome
439442
mutable std::mutex m_mutex;
440443
GUID m_id;
441444
std::wstring m_computerName;
445+
std::wstring m_orcComputerName;
442446
Mothership m_mothership;
443447
std::wstring m_consoleFileName;
444448
std::wstring m_logFileName;

src/OrcCommand/Command/WolfLauncher/WolfLauncher_Run.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ void UpdateOutcome(Command::Wolf::Outcome::Outcome& outcome, const GUID& id, HAN
227227
outcome.SetComputerNameValue(computerName);
228228
}
229229

230+
{
231+
std::wstring orcComputerName;
232+
SystemDetails::GetOrcFullComputerName(orcComputerName);
233+
outcome.SetOrcComputerNameValue(orcComputerName);
234+
}
235+
230236
{
231237
std::wstring timestampKey;
232238
HRESULT hr = SystemDetails::GetTimeStamp(timestampKey);

0 commit comments

Comments
 (0)