Sandboxie/SandboxiePlus/QSbieAPI/SbieUtils.h

62 lines
2.3 KiB
C
Raw Normal View History

2021-10-16 16:19:51 +01:00
#pragma once
#include "qsbieapi_global.h"
#include "SbieStatus.h"
class QSBIEAPI_EXPORT CSbieUtils
{
public:
enum EComponent
{
eNone = 0,
eDriver = 0x01,
eService = 0x02,
eAll = 0xFF
};
2023-07-01 17:54:53 +01:00
static bool WildCompare(const QString& L, const QString& R);
2021-10-16 16:19:51 +01:00
static SB_STATUS DoAssist();
2022-02-02 18:31:03 +00:00
static SB_RESULT(void*) Start(EComponent Component);
static SB_RESULT(void*) Stop(EComponent Component);
2021-10-16 16:19:51 +01:00
static bool IsRunning(EComponent Component);
2022-02-02 18:31:03 +00:00
static SB_RESULT(void*) Install(EComponent Component);
static SB_RESULT(void*) Uninstall(EComponent Component);
2021-10-16 16:19:51 +01:00
static bool IsInstalled(EComponent Component);
static QString GetContextMenuStartCmd();
2022-02-13 12:24:16 +00:00
static void AddContextMenu(const QString& StartPath, const QString& RunStr, /*const QString& ExploreStr,*/ const QString& IconPath = QString());
2021-10-16 16:19:51 +01:00
static void RemoveContextMenu();
2022-02-04 21:08:25 +00:00
static bool HasContextMenu2();
static void AddContextMenu2(const QString& StartPath, const QString& RunStr, const QString& IconPath = QString());
static void RemoveContextMenu2();
2023-07-01 17:54:53 +01:00
static bool CreateShortcut(const QString& StartExe, QString LinkPath, const QString &LinkName, const QString &boxname, const QString &arguments, const QString &iconPath = QString(), int iconIndex = 0, const QString &workdir = QString(), bool bRunElevated = false);
2021-10-16 16:19:51 +01:00
static bool GetStartMenuShortcut(class CSbieAPI* pApi, QString &BoxName, QString &LinkPath, QString &IconPath, quint32& IconIndex, QString &WorkDir);
2022-02-05 11:42:04 +00:00
static CSbieProgressPtr RunCommand(const QString& Command, bool noGui = false);
2023-01-25 11:54:41 +00:00
static int ExecCommand(const QString& Command, bool noGui = false, quint32 Timeout = -1);
static int ExecCommandEx(const QString& Command, QString* pOutput, quint32 Timeout = -1);
2021-10-16 16:19:51 +01:00
private:
2022-02-02 18:31:03 +00:00
static SB_RESULT(void*) ElevateOps(const QStringList& Ops);
2021-10-16 16:19:51 +01:00
static SB_STATUS ExecOps(const QStringList& Ops);
static void Start(EComponent Component, QStringList& Ops);
static void Stop(EComponent Component, QStringList& Ops);
static void Install(EComponent Component, QStringList& Ops);
static void Uninstall(EComponent Component, QStringList& Ops);
2022-09-29 17:28:48 +01:00
static void CreateShellEntry(const std::wstring& classname, const std::wstring& key, const std::wstring& cmdtext, const std::wstring& iconpath, const std::wstring& startcmd);
2021-10-16 16:19:51 +01:00
};
bool QSBIEAPI_EXPORT ShellOpenRegKey(const QString& KeyName);