This commit is contained in:
love-code-yeyixiao 2024-05-18 10:29:30 +08:00
parent 7b86aad61a
commit a799ce3f0f
6 changed files with 11 additions and 11 deletions

View File

@ -1031,9 +1031,9 @@ QString CSbieAPI::GetUserSection(QString* pUserName, bool* pIsAdmin) const
SB_RESULT(quint32) CSbieAPI::RunStart(const QString& BoxName, const QString& Command, bool Elevated, const QString& WorkingDir, QProcess* pProcess)
{
return RunStart(BoxName, Command, Elevated, WorkingDir, false, pProcess);
return RunStartWithFCP(BoxName, Command,false, Elevated, WorkingDir, pProcess);
}
SB_RESULT(quint32) CSbieAPI::RunStart(const QString& BoxName, const QString& Command, bool Elevated, const QString& WorkingDir,bool isFCP, QProcess* pProcess)
SB_RESULT(quint32) CSbieAPI::RunStartWithFCP(const QString& BoxName, const QString& Command, bool isFCP,bool Elevated, const QString& WorkingDir, QProcess* pProcess)
{
if (m_SbiePath.isEmpty())
return SB_ERR(SB_PathFail);

View File

@ -154,7 +154,7 @@ public:
virtual QString GetSbieMsgStr(quint32 code, quint32 Lang = 1033);
virtual SB_RESULT(quint32) RunStart(const QString& BoxName, const QString& Command, bool Elevated = false, const QString& WorkingDir = QString(), QProcess* pProcess = NULL);
virtual SB_RESULT(quint32) RunStart(const QString& BoxName, const QString& Command, bool Elevated = false, const QString& WorkingDir = QString(), bool isFCP,QProcess* pProcess = NULL);
virtual SB_RESULT(quint32) RunStartWithFCP(const QString& BoxName, const QString& Command, bool isFCP,bool Elevated = false, const QString& WorkingDir = QString(),QProcess* pProcess = NULL);
virtual QString GetStartPath() const;
virtual quint32 GetSessionID() const;

View File

@ -1714,9 +1714,9 @@ bool CSandMan::RunSandboxed(const QStringList& Commands, QString BoxName, const
SB_RESULT(quint32) CSandMan::RunStart(const QString& BoxName, const QString& Command, bool Elevated, const QString& WorkingDir, QProcess* pProcess)
{
return RunStart(BoxName, Command, Elevated, WorkingDir, false, pProcess);
return RunStartWithFCP(BoxName, Command, false, Elevated, WorkingDir, pProcess);
}
SB_RESULT(quint32) CSandMan::RunStart(const QString& BoxName, const QString& Command, bool Elevated, const QString& WorkingDir,bool isFCP, QProcess* pProcess)
SB_RESULT(quint32) CSandMan::RunStartWithFCP(const QString& BoxName, const QString& Command, bool isFCP, bool Elevated, const QString& WorkingDir, QProcess* pProcess)
{
auto pBoxEx = theAPI->GetBoxByName(BoxName).objectCast<CSandBoxPlus>();
if (pBoxEx && pBoxEx->UseImageFile() && pBoxEx->GetMountRoot().isEmpty()) {
@ -1726,7 +1726,7 @@ SB_RESULT(quint32) CSandMan::RunStart(const QString& BoxName, const QString& Com
return Status;
}
return theAPI->RunStart(BoxName, Command, Elevated, WorkingDir,isFCP, pProcess);
return theAPI->RunStartWithFCP(BoxName, Command, isFCP, Elevated, WorkingDir, pProcess);
}
SB_STATUS CSandMan::ImBoxMount(const CSandBoxPtr& pBox, bool bAutoUnmount)
{

View File

@ -93,7 +93,7 @@ public:
bool RunSandboxed(const QStringList& Commands, QString BoxName = QString(), const QString& WrkDir = QString());
SB_RESULT(quint32) RunStart(const QString& BoxName, const QString& Command, bool Elevated = false, const QString& WorkingDir = QString(), QProcess* pProcess = NULL);
SB_RESULT(quint32) RunStart(const QString& BoxName, const QString& Command, bool Elevated = false, const QString& WorkingDir = QString(), bool isFCP,QProcess* pProcess = NULL);
SB_RESULT(quint32) RunStartWithFCP(const QString& BoxName, const QString& Command, bool isFCP, bool Elevated = false, const QString& WorkingDir = QString(),QProcess* pProcess = NULL);
SB_STATUS ImBoxMount(const CSandBoxPtr& pBox, bool bAutoUnmount = false);
void EditIni(const QString& IniPath, bool bPlus = false);

View File

@ -95,13 +95,13 @@ void CSbiePlusAPI::StopMonitor()
SB_RESULT(quint32) CSbiePlusAPI::RunStart(const QString& BoxName, const QString& Command, bool Elevated, const QString& WorkingDir, QProcess* pProcess)
{
return RunStart(BoxName,Command,Elevated,WorkingDir,false,pProcess);
return RunStartWithFCP(BoxName,Command,false,Elevated,WorkingDir,pProcess);
}
SB_RESULT(quint32) CSbiePlusAPI::RunStart(const QString& BoxName, const QString& Command, bool Elevated, const QString& WorkingDir, bool isFCP,QProcess* pProcess)
SB_RESULT(quint32) CSbiePlusAPI::RunStartWithFCP(const QString& BoxName, const QString& Command, bool isFCP, bool Elevated, const QString& WorkingDir,QProcess* pProcess)
{
if (!pProcess)
pProcess = new QProcess(this);
SB_RESULT(quint32) Status = CSbieAPI::RunStart(BoxName, Command, Elevated, WorkingDir, pProcess);
SB_RESULT(quint32) Status = CSbieAPI::RunStartWithFCP(BoxName, Command,isFCP, Elevated, WorkingDir, pProcess);
if (pProcess->parent() == this) {
if (!Status.IsError()) {
connect(pProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(OnStartFinished()));

View File

@ -32,7 +32,7 @@ public:
virtual void StopMonitor();
virtual SB_RESULT(quint32) RunStart(const QString& BoxName, const QString& Command, bool Elevated = false, const QString& WorkingDir = QString(), QProcess* pProcess = NULL);
virtual SB_RESULT(quint32) RunStart(const QString& BoxName, const QString& Command, bool Elevated = false, const QString& WorkingDir = QString(), bool isFCP,QProcess* pProcess = NULL);
virtual SB_RESULT(quint32) RunStartWithFCP(const QString& BoxName, const QString& Command, bool isFCP,bool Elevated = false, const QString& WorkingDir = QString(),QProcess* pProcess = NULL);
virtual bool IsStarting(qint64 pid) const { return m_PendingStarts.contains(pid); }
private slots: