@@ -103,7 +103,7 @@ Orc::Result<std::string> WincryptBinaryToString(std::string_view buffer)
103
103
{
104
104
std::error_code ec = LastWin32Error ();
105
105
Log::Debug (" Failed CryptBinaryToStringA while calculating output length [{}]" , ec);
106
- return nullptr ;
106
+ return ec ;
107
107
}
108
108
109
109
publicKey.resize (publicKeySize);
@@ -117,7 +117,7 @@ Orc::Result<std::string> WincryptBinaryToString(std::string_view buffer)
117
117
{
118
118
std::error_code ec = LastWin32Error ();
119
119
Log::Debug (" Failed CryptBinaryToStringA while converting binary blob [{}]" , ec);
120
- return nullptr ;
120
+ return ec ;
121
121
}
122
122
123
123
publicKey.erase (boost::remove_if (publicKey, boost::is_any_of (" \r\n " )), publicKey.end ());
@@ -219,8 +219,6 @@ Result<std::wstring> GetProcessExecutableHash(DWORD dwProcessId, CryptoHashStrea
219
219
220
220
void UpdateOutcome (Command::Wolf::Outcome::Outcome& outcome, const GUID& id, HANDLE hMothership)
221
221
{
222
- auto && lock = outcome.Lock ();
223
-
224
222
outcome.SetId (id);
225
223
226
224
{
@@ -776,13 +774,15 @@ Orc::Result<void> Main::CreateAndUploadOutcome()
776
774
return Success<void >();
777
775
}
778
776
779
- ::UpdateOutcome (m_outcome, m_guid, m_hMothership);
780
- ::UpdateOutcome (m_outcome, config.m_Recipients);
781
- ::UpdateOutcome (m_outcome, m_standardOutput);
782
- ::UpdateOutcome (m_outcome, m_logging);
783
- ::UpdateOutcomeWithOutline (m_outcome, config.Outline);
777
+ auto [outcome, lock] = m_outcome.Get ();
778
+
779
+ ::UpdateOutcome (outcome, m_guid, m_hMothership);
780
+ ::UpdateOutcome (outcome, config.m_Recipients);
781
+ ::UpdateOutcome (outcome, m_standardOutput);
782
+ ::UpdateOutcome (outcome, m_logging);
783
+ ::UpdateOutcomeWithOutline (outcome, config.Outline);
784
784
785
- auto rv = ::DumpOutcome (m_outcome , config.Outcome );
785
+ auto rv = ::DumpOutcome (outcome , config.Outcome );
786
786
if (rv.has_error ())
787
787
{
788
788
0 commit comments