[*] Harden auprocesses / async outputof
This commit is contained in:
parent
7df1d1dd27
commit
b3557ed938
@ -600,7 +600,10 @@ namespace Aurora::Processes
|
||||
if (!pResult->pTransactionB->StartRead(0, AuUnsafeRaiiToShared(&pResult->readErrView)))
|
||||
{
|
||||
pResult->result.bFailed = true;
|
||||
if (pResult->pTransactionA)
|
||||
{
|
||||
pResult->pTransactionA->SetCallback({});
|
||||
}
|
||||
return pResult;
|
||||
}
|
||||
|
||||
@ -612,40 +615,75 @@ namespace Aurora::Processes
|
||||
if (!pResult->pLoopQueue->SourceAdd(pResult->pTransactionSourceA))
|
||||
{
|
||||
pResult->result.bFailed = true;
|
||||
if (pResult->pTransactionA)
|
||||
{
|
||||
pResult->pTransactionA->SetCallback({});
|
||||
}
|
||||
if (pResult->pTransactionB)
|
||||
{
|
||||
pResult->pTransactionB->SetCallback({});
|
||||
}
|
||||
pResult->CleanUp();
|
||||
return pResult;
|
||||
}
|
||||
|
||||
if (!pResult->pLoopQueue->SourceAdd(pResult->pTransactionSourceB))
|
||||
{
|
||||
pResult->result.bFailed = true;
|
||||
if (pResult->pTransactionA)
|
||||
{
|
||||
pResult->pTransactionA->SetCallback({});
|
||||
}
|
||||
if (pResult->pTransactionB)
|
||||
{
|
||||
pResult->pTransactionB->SetCallback({});
|
||||
}
|
||||
pResult->CleanUp();
|
||||
return pResult;
|
||||
}
|
||||
|
||||
if (!pResult->pLoopQueue->SourceAdd(pResult->pProcessDeadLoopSource))
|
||||
{
|
||||
pResult->result.bFailed = true;
|
||||
if (pResult->pTransactionA)
|
||||
{
|
||||
pResult->pTransactionA->SetCallback({});
|
||||
}
|
||||
if (pResult->pTransactionB)
|
||||
{
|
||||
pResult->pTransactionB->SetCallback({});
|
||||
}
|
||||
pResult->CleanUp();
|
||||
return pResult;
|
||||
}
|
||||
|
||||
if (!pResult->pLoopQueue->AddCallback(pResult->pProcessDeadLoopSource, pProcessDeadCallback))
|
||||
{
|
||||
pResult->result.bFailed = true;
|
||||
if (pResult->pTransactionA)
|
||||
{
|
||||
pResult->pTransactionA->SetCallback({});
|
||||
}
|
||||
if (pResult->pTransactionB)
|
||||
{
|
||||
pResult->pTransactionB->SetCallback({});
|
||||
}
|
||||
pResult->CleanUp();
|
||||
return pResult;
|
||||
}
|
||||
|
||||
if (!pResult->pLoopQueue->Commit())
|
||||
{
|
||||
pResult->result.bFailed = true;
|
||||
if (pResult->pTransactionA)
|
||||
{
|
||||
pResult->pTransactionA->SetCallback({});
|
||||
}
|
||||
if (pResult->pTransactionB)
|
||||
{
|
||||
pResult->pTransactionB->SetCallback({});
|
||||
}
|
||||
pResult->CleanUp();
|
||||
return pResult;
|
||||
}
|
||||
|
||||
|
@ -697,11 +697,13 @@ namespace Aurora::Processes
|
||||
if (this->desc.username)
|
||||
{
|
||||
wideusername = AuLocale::ConvertFromUTF8(this->desc.username.value().c_str());
|
||||
AuMemset(this->desc.username.value().data(), 0xFF, this->desc.username.value().size());
|
||||
}
|
||||
|
||||
if (this->desc.password)
|
||||
{
|
||||
widepassword = AuLocale::ConvertFromUTF8(this->desc.password.value().c_str());
|
||||
AuMemset(this->desc.password.value().data(), 0xFF, this->desc.password.value().size());
|
||||
}
|
||||
|
||||
if (this->desc.server)
|
||||
@ -759,6 +761,7 @@ namespace Aurora::Processes
|
||||
|
||||
if (wideusername.empty())
|
||||
{
|
||||
AuMemset(widepassword.data(), 0xFF, widepassword.size());
|
||||
SysPushErrorPermissionError("Missing Username");
|
||||
return false;
|
||||
}
|
||||
@ -791,11 +794,16 @@ namespace Aurora::Processes
|
||||
if (status == EPrompt::eCancel ||
|
||||
wideusername.empty())
|
||||
{
|
||||
AuMemset(wideusername.data(), 0xFF, wideusername.size() * sizeof(wchar_t));
|
||||
AuMemset(widepassword.data(), 0xFF, widepassword.size() * sizeof(wchar_t));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (status == EPrompt::eError)
|
||||
{
|
||||
|
||||
AuMemset(wideusername.data(), 0xFF, wideusername.size() * sizeof(wchar_t));
|
||||
AuMemset(widepassword.data(), 0xFF, widepassword.size() * sizeof(wchar_t));
|
||||
SysPushErrorGeneric("Generic logon prompt failure");
|
||||
return false;
|
||||
}
|
||||
@ -848,6 +856,8 @@ namespace Aurora::Processes
|
||||
{}, {}, {}, {}) != ERROR_SUCCESS)
|
||||
{
|
||||
SysPushErrorPermissionError("Unable to elevate");
|
||||
AuMemset(wideusername.data(), 0xFF, wideusername.size() * sizeof(wchar_t));
|
||||
AuMemset(widepassword.data(), 0xFF, widepassword.size() * sizeof(wchar_t));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -874,6 +884,8 @@ namespace Aurora::Processes
|
||||
LOGON32_PROVIDER_DEFAULT,
|
||||
&hBestToken))
|
||||
{
|
||||
AuMemset(wideusername.data(), 0xFF, wideusername.size() * sizeof(wchar_t));
|
||||
AuMemset(widepassword.data(), 0xFF, widepassword.size() * sizeof(wchar_t));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -882,6 +894,8 @@ namespace Aurora::Processes
|
||||
GetTokenIntegrityLevel()))
|
||||
{
|
||||
SysPushErrorPermissionError("Unable to elevate");
|
||||
AuMemset(wideusername.data(), 0xFF, wideusername.size() * sizeof(wchar_t));
|
||||
AuMemset(widepassword.data(), 0xFF, widepassword.size() * sizeof(wchar_t));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -955,6 +969,9 @@ namespace Aurora::Processes
|
||||
pRevertToSelf();
|
||||
}
|
||||
|
||||
AuMemset(wideusername.data(), 0xFF, wideusername.size() * sizeof(wchar_t));
|
||||
AuMemset(widepassword.data(), 0xFF, widepassword.size() * sizeof(wchar_t));
|
||||
|
||||
AuWin32CloseHandle(hBestToken);
|
||||
|
||||
if (!bResult)
|
||||
|
Loading…
Reference in New Issue
Block a user