diff --git a/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp b/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp index 2b4a4b92..1daec752 100644 --- a/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp +++ b/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp @@ -275,6 +275,11 @@ void CBoxedProcess::InitProcessInfoImpl(void* ProcessHandle) { m_CommandLine = CBoxedProcess__GetPebString(ProcessHandle, PhpoCommandLine); } + + if (m_WorkingDir.isEmpty()) + { + m_WorkingDir = CBoxedProcess__GetPebString(ProcessHandle, PhpoCurrentDirectory); + } } bool CBoxedProcess::InitProcessInfoEx() diff --git a/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.h b/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.h index 6f812848..9958645a 100644 --- a/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.h +++ b/SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.h @@ -36,6 +36,7 @@ public: virtual quint32 GetParendPID() const { return m_ParendPID; } virtual QString GetProcessName() const { return m_ImageName; } virtual QString GetCommandLine() const { return m_CommandLine; } + virtual QString GetWorkingDir() const { return m_WorkingDir; } virtual QString GetFileName() const { return m_ImagePath; } virtual QDateTime GetTimeStamp() const { return m_StartTime; } virtual quint32 GetProcessFlags() const { return m_ProcessFlags; } @@ -73,6 +74,7 @@ protected: quint32 m_ProcessFlags; quint32 m_ImageType; QString m_CommandLine; + QString m_WorkingDir; quint32 m_SessionId; QDateTime m_StartTime; quint32 m_ReturnCode; diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index 584577a4..7e4061c4 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -628,7 +628,7 @@ void CSbieView::UpdateProcMenu(const CBoxedProcessPtr& pProcess, int iProcessCou if (m_pMenuPreset) { m_pMenuPinToRun->setChecked(!FoundPin.isEmpty()); m_pMenuPinToRun->setData(FoundPin); - //m_pMenuPinToRun->setProperty("WorkingDir", pProcess-> // todo + m_pMenuPinToRun->setProperty("WorkingDir", pProcess->GetWorkingDir()); m_pMenuAllowInternet->setChecked(pProcess.objectCast()->HasInternetAccess()); @@ -1470,7 +1470,7 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList& SandB Results.append(theGUI->RunStart(SandBoxes.first()->GetName(), "start_menu", false, WorkingDir)); else { auto pBoxEx = SandBoxes.first().objectCast(); - Results.append(theGUI->RunStart(SandBoxes.first()->GetName(), pBoxEx->GetFullCommand(Command), false, WorkingDir)); + Results.append(theGUI->RunStart(SandBoxes.first()->GetName(), pBoxEx->GetFullCommand(Command), false, pBoxEx->GetFullCommand(WorkingDir))); } } diff --git a/SandboxiePlus/version.h b/SandboxiePlus/version.h index 669b98be..2a3bcd7d 100644 --- a/SandboxiePlus/version.h +++ b/SandboxiePlus/version.h @@ -3,7 +3,7 @@ #define VERSION_MJR 1 #define VERSION_MIN 10 #define VERSION_REV 1 -#define VERSION_UPD 3 +#define VERSION_UPD 5 #ifndef STR #define STR2(X) #X