From effaaea8f6fdc7621b90512841078df78b630357 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Sat, 28 Jan 2023 21:49:24 +0100 Subject: [PATCH] 1.7.0c --- Sandboxie/common/win32_ntddk.h | 4 ++-- SandboxiePlus/SandMan/Models/SbieModel.cpp | 17 ++++++++++++----- .../SandMan/Resources/Actions/AdminShield.png | Bin 0 -> 2684 bytes .../SandMan/Resources/Actions/SystemShield.png | Bin 0 -> 2708 bytes .../SandMan/Resources/Actions/USB.png | Bin 0 -> 1224 bytes SandboxiePlus/SandMan/Resources/SandMan.qrc | 3 +++ SandboxiePlus/SandMan/SandMan.cpp | 8 +++----- SandboxiePlus/SandMan/SandMan.h | 2 +- SandboxiePlus/SandMan/SbieProcess.cpp | 2 +- 9 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 SandboxiePlus/SandMan/Resources/Actions/AdminShield.png create mode 100644 SandboxiePlus/SandMan/Resources/Actions/SystemShield.png create mode 100644 SandboxiePlus/SandMan/Resources/Actions/USB.png diff --git a/Sandboxie/common/win32_ntddk.h b/Sandboxie/common/win32_ntddk.h index 511de73b..5412c96d 100644 --- a/Sandboxie/common/win32_ntddk.h +++ b/Sandboxie/common/win32_ntddk.h @@ -2283,8 +2283,8 @@ __declspec(dllimport) NTSTATUS RtlGetGroupSecurityDescriptor( PSID* Group, PBOOLEAN GroupDefaulted ); -__declspec(dllimport) BOOLEAN RtlEqualSid(PSID Sid1, PSID Sid2); -__declspec(dllimport) PVOID RtlFreeSid(PSID Sid); +__declspec(dllimport) BOOLEAN NTAPI RtlEqualSid(PSID Sid1, PSID Sid2); +__declspec(dllimport) PVOID NTAPI RtlFreeSid(PSID Sid); //--------------------------------------------------------------------------- diff --git a/SandboxiePlus/SandMan/Models/SbieModel.cpp b/SandboxiePlus/SandMan/Models/SbieModel.cpp index d14751f2..4cb806cd 100644 --- a/SandboxiePlus/SandMan/Models/SbieModel.cpp +++ b/SandboxiePlus/SandMan/Models/SbieModel.cpp @@ -261,8 +261,8 @@ QList CSbieModel::Sync(const QMap& BoxList, cons else { pNode->busyState = 0; - if(boxDel && !bVintage) - Icon = theGUI->MakeIconRecycle(Icon); + if (boxDel && !bVintage) + Icon = theGUI->IconAddOverlay(Icon, ":/Boxes/AutoDel"); } if (m_LargeIcons) // but not for boxes @@ -383,9 +383,16 @@ bool CSbieModel::Sync(const CSandBoxPtr& pBox, const QList& Path, cons //else // pNode->Icon = icons.first().pixmap; - pNode->Icon = m_IconProvider.icon(QFileInfo(pProcess->GetFileName())); - if (pNode->Icon.isNull() || !pNode->Icon.isValid()) - pNode->Icon = m_ExeIcon; + QIcon Icon = m_IconProvider.icon(QFileInfo(pProcess->GetFileName())); + if (Icon.isNull()) + Icon = m_ExeIcon; + + if(pProcess->HasSystemToken()) + Icon = theGUI->IconAddOverlay(Icon, ":/Actions/SystemShield.png", 20); + else if(pProcess->HasElevatedToken()) + Icon = theGUI->IconAddOverlay(Icon, ":/Actions/AdminShield.png", 20); + + pNode->Icon = Icon; Changed = 1; } diff --git a/SandboxiePlus/SandMan/Resources/Actions/AdminShield.png b/SandboxiePlus/SandMan/Resources/Actions/AdminShield.png new file mode 100644 index 0000000000000000000000000000000000000000..483d4d9b1881ba3d17f7a1a660c2b11b9a2f18f6 GIT binary patch literal 2684 zcmV-?3WN2DP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3K2;}K~!i%&01@W zT~!rcXF5!Eq@Yl>7Azn>K#3wKfzrqNzWKK#XV$@j-}*Ku8r@ zr7#$cwNjDPDec4t%k(v4JAF8%77J4-eM~#gd+#~N?_2wE_Br?5>Ci`fFa-&;2;yH(oVIIcL5gyp9HQ0DCS&%{Tu)&Vx7f* zfPP?7*;L?zz+=EsAUzI_0ZRZL!(%6far*oKcnzol2~b8p1lzDJkKwUr0VicAJGDLo z+yPtxyp;*Hv(Lx1{+vYTUL?_(Z92c`g!G7B{eL@v5knt0|E7axe*zO2=>G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u3h6IrJW%(WRb%J(gTZY5YOb{nY zfP&N~B^_zTP#3Al}(L)Q$=A(xx6D;h+FtF!se|2 zlJNpaQvE=H3Nz(Ktn*DiebGPH^SS*w!0)u75U&2m0R6^def^-+6ZGOqF~q3x)I z0^HhypM(OeZ|j+L$#&>O>jR^yq+9qEm>Q?cooflz^{ z6E)eia7VS(Oley|M#{2k_x@ z*D%(#?#HKM*1NO4No2=rpXo8`%Cb*v43fUEJ_$NNpT zXzhf&06Yl{vfuBX_?MYtl>#gZ0th;ck!5Zcsw}|QbplibeWp3#f&e>u+(Vnc z=#%WI9;IlUPJI8ON0PF&6GG$LB`&IG=sb@V^P>@-2pqwjXiZ@A3sfcAz}CirC3Z{C;eNQRX3bsg?)TIoqoQ^v!5Bx_e; z|K}7#9X}#G^0N)0zA0zD=Efru|Jm|#h@7q2veHLue$*w!fB*r5k|_92?bEp#D+tXJgp-EPhZQe1^Br(sR-I+ zYa}#wd>?QRz^NwpHTz`s=uR2WP^5$iC&H4makrKFEmzlr^HFC!m5F=%B-!HMT60R@ z4e*+1J+)0&h_l}TKL%c>^T+sze5wAj^ka0Y1o(U?fV8Xt#<(kut=%ul-~CG|j{X|p zLG`9-?^g&<#!mx$0m}D$vOOJ;WsU9F)i5Qz0G3!0NX;$QB?tm!G3b|+HfUXbokc3f) z@j>_0F_~D8Bi$HPs`0hPFM+=R{&{w~X0LeCb_MVQ;OhW?wjozWr^`cgFPDpJ-E>vV zf(>}IrYLUJ{g_JY`y}o4T=|f}Q^c)QC~tn0x`v$?C6WYQUKzOom%7g!9;8oLGHp^gtdO7@~?e)dGi71_KW_GGn>&T|3? zeq^)mcYs-GeCzpJfCoG-?~pvfnEM?HUwO}3xB@Ev5Y@7IMwx8uo>+v zF#gz}2e=mCl;d@H=;Px7cRZdFX4F0?AbR literal 0 HcmV?d00001 diff --git a/SandboxiePlus/SandMan/Resources/Actions/USB.png b/SandboxiePlus/SandMan/Resources/Actions/USB.png new file mode 100644 index 0000000000000000000000000000000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=k>(o~*hZD37o;O|!1!*x+|CklD zB7G%4MfmCwBT0J0qZpE;zDn_|plxuX_C}}?#t7;=3{lsQ|66#)5S2c1Q8+#|j;KXO z(7p(KCA{`wHv0l2Xcriw>OGt|9lgSUAN8`rcMM6!V!ZNtsM)MN9BFG0N5H4rLd|O7 zNM~EPqYHc~(%HNqk;`tY&z1&Q+mtCo* m?yKx=jBRwkEo)h*w*3okMU2k}2w+wK0000Actions/BFance.png Actions/Shield16.png Actions/Editor.png + Actions/USB.png + Actions/SystemShield.png + Actions/AdminShield.png Boxes/sandbox-b-empty.png diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 72f371f0..94cccde6 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -1201,11 +1201,9 @@ QIcon CSandMan::MakeIconBusy(const QIcon& Icon, int Index) return QIcon(result); } -QIcon CSandMan::MakeIconRecycle(const QIcon& Icon) +QIcon CSandMan::IconAddOverlay(const QIcon& Icon, const QString& Name, int Size) { - static QPixmap overlay; - if(overlay.isNull()) - overlay = QPixmap(":/Boxes/AutoDel"); + QPixmap overlay = QPixmap(Name).scaled(Size, Size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); QPixmap base = Icon.pixmap(32, 32); QPixmap result(base.width(), base.height()); @@ -1213,7 +1211,7 @@ QIcon CSandMan::MakeIconRecycle(const QIcon& Icon) QPainter painter(&result); painter.drawPixmap(0, 0, base); - painter.drawPixmap(8, 8, overlay); + painter.drawPixmap(32 - Size, 32 - Size, overlay); return QIcon(result); } diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h index f873b3a3..dc2cf945 100644 --- a/SandboxiePlus/SandMan/SandMan.h +++ b/SandboxiePlus/SandMan/SandMan.h @@ -69,7 +69,7 @@ public: QRgb GetBoxColor(int boxType) { return m_BoxColors[boxType]; } QIcon GetColorIcon(QColor boxColor, bool inUse = false/*, bool bOut = false*/); QIcon MakeIconBusy(const QIcon& Icon, int Index = 0); - QIcon MakeIconRecycle(const QIcon& Icon); + QIcon IconAddOverlay(const QIcon& Icon, const QString& Name, int Size = 24); QString GetBoxDescription(int boxType); bool CheckCertificate(QWidget* pWidget); diff --git a/SandboxiePlus/SandMan/SbieProcess.cpp b/SandboxiePlus/SandMan/SbieProcess.cpp index 79d0364f..467efa77 100644 --- a/SandboxiePlus/SandMan/SbieProcess.cpp +++ b/SandboxiePlus/SandMan/SbieProcess.cpp @@ -156,4 +156,4 @@ void CSbieProcess::InitProcessInfoImpl(void* ProcessHandle) CloseHandle(TokenHandle); } -} \ No newline at end of file +}