2022-02-05 14:09:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "SbiePlusAPI.h"
|
|
|
|
|
|
|
|
class CSbieProcess : public CBoxedProcess
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-01-28 19:57:20 +00:00
|
|
|
CSbieProcess(quint32 ProcessId, class CSandBox* pBox);
|
2022-02-05 14:09:53 +00:00
|
|
|
|
|
|
|
virtual QString GetStatusStr() const;
|
|
|
|
|
2023-01-28 19:57:20 +00:00
|
|
|
virtual void BlockProgram() { GetBox()->BlockProgram(m_ImageName); }
|
|
|
|
virtual void SetInternetAccess(bool bSet) { GetBox()->SetInternetAccess(m_ImageName, bSet); }
|
|
|
|
virtual bool HasInternetAccess() { return GetBox()->HasInternetAccess(m_ImageName); }
|
|
|
|
virtual void SetForcedProgram(bool bSet) { GetBox()->SetForcedProgram(m_ImageName, bSet); }
|
|
|
|
virtual bool IsForcedProgram() { return GetBox()->IsForcedProgram(m_ImageName); }
|
|
|
|
virtual void SetLingeringProgram(bool bSet) { GetBox()->SetLingeringProgram(m_ImageName, bSet); }
|
|
|
|
virtual int IsLingeringProgram() { return GetBox()->IsLingeringProgram(m_ImageName); }
|
|
|
|
virtual void SetLeaderProgram(bool bSet) { GetBox()->SetLeaderProgram(m_ImageName, bSet); }
|
|
|
|
virtual int IsLeaderProgram() { return GetBox()->IsLeaderProgram(m_ImageName); }
|
2022-02-05 14:09:53 +00:00
|
|
|
|
|
|
|
virtual CSandBoxPlus* GetBox() { return qobject_cast<CSandBoxPlus*>(m_pBox); }
|
|
|
|
|
2023-01-28 19:57:20 +00:00
|
|
|
virtual int GetRememberedAction(int Action) { return m_RememberedActions.value(Action, -1); }
|
|
|
|
virtual void SetRememberedAction(int Action, int retval) { m_RememberedActions.insert(Action, retval); }
|
2022-02-05 14:09:53 +00:00
|
|
|
|
2023-01-28 19:57:20 +00:00
|
|
|
static QString ImageTypeToStr(quint32 type);
|
|
|
|
|
|
|
|
virtual bool HasElevatedToken() { return m_ProcessInfo.IsElevated; }
|
|
|
|
virtual bool HasSystemToken() { return m_ProcessInfo.IsSystem; }
|
2023-04-07 16:22:54 +01:00
|
|
|
virtual bool HasRestrictedToken() { return m_ProcessInfo.IsRestricted; }
|
|
|
|
virtual bool HasAppContainerToken() { return m_ProcessInfo.IsAppContainer; }
|
2022-02-05 14:09:53 +00:00
|
|
|
|
|
|
|
protected:
|
2023-01-28 19:57:20 +00:00
|
|
|
|
|
|
|
virtual void InitProcessInfoImpl(void* ProcessHandle);
|
|
|
|
|
2022-02-05 14:09:53 +00:00
|
|
|
QMap<int, int> m_RememberedActions;
|
2023-01-28 19:57:20 +00:00
|
|
|
|
|
|
|
// Flags
|
|
|
|
union
|
|
|
|
{
|
|
|
|
quint32 Flags;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
quint32
|
|
|
|
IsElevated : 1,
|
|
|
|
IsSystem : 1,
|
2023-04-07 16:22:54 +01:00
|
|
|
IsRestricted : 1,
|
|
|
|
IsAppContainer : 1,
|
|
|
|
Spare : 28;
|
2023-01-28 19:57:20 +00:00
|
|
|
};
|
|
|
|
} m_ProcessInfo;
|
2022-02-05 14:09:53 +00:00
|
|
|
};
|